ui5 load josn
2024-10-01 12:10:21
sap.ui.jsview("ui5p.Test01", { /** Specifies the Controller belonging to this View.
* In the case that it is not implemented, or that "null" is returned, this View does not have a Controller.
* @memberOf ui5p.Test01
*/
getControllerName : function() {
return "ui5p.Test01";
}, /** Is initially called once after the Controller has been instantiated. It is the place where the UI is constructed.
* Since the Controller is given to this method, its event handlers can be attached right away.
* @memberOf ui5p.Test01
*/
createContent : function(oController) { var mtable=new sap.ui.table.Table('mtable',{title:'testtable'}); mtable.addColumn(new sap.ui.table.Column({
label: new sap.ui.commons.Label({text: "Last Name"}),
template: new sap.ui.commons.TextView({text:"{lastName}"})
})); // create some local data
var naughtyList = [
{lastName: "Dente", name: "Al", stillNaughty: true},
{lastName: "Friese", name: "Andy", stillNaughty: true},
{lastName: "Mann", name: "Anita", stillNaughty: false}
]; var oModel = new sap.ui.model.json.JSONModel();
//type 1
//oModel.loadData("http://localhost:8080/UI5P/ui5p/data01.json"); //type 2
oModel.loadData("./ui5p/data01.json"); //type 3
//oModel.setData(naughtyList); mtable.setModel(oModel);
mtable.bindRows("/"); return mtable;
} });
data01.json 文件内容 [
{"lastName": "Dente", "name": "Al"},
{"lastName": "Friese", "name": "Andy"},
{"lastName": "Mann", "name": "Anita"}
]
最新文章
- Fold Change和t分布
- 贪吃蛇,JavaScript,效果,鼠标事件
- 007商城项目:商品列表查询-需求分析,以及Spinmvc的访问知识
- mysql之各种命令总结
- IOS开发UI基础UISwitch属性
- php 同步因子的并发处理
- 二进制序列化框架easypack发布啦!
- Unity3D研究院之打开Activity与调用JAVA代码传递参数
- RichEdit中插入带背景色文本的一种思路
- FTP: Configuring server users..
- JAVA设计模式:蝇量模式
- Java面试总结(二)
- 用SpriteBuilder简化";耕牛遍地走";的动画效果(二)
- tensorflow 莫烦教程
- Skywalking部署常见问题以及注意事项
- C++ opencv调用resize修改插值方式遇到的坑
- 序言:我为什么学Perl
- vue+axios如何操作数据交互
- MVC中的Ajax与增删改查(一)
- kubernetes 实战5_命令_Assign Pods to Nodes&;Configure a Pod to Use a ConfigMap