sap.ui.table树表中的错误绑定

2020-08-25 12:01发布

         点击此处--->   EasySAP.com群内免费提供SAP练习系统(在群公告中)

加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)


大家好,

我在sap.ui.table树表中绑定时遇到一些问题。 该树结构在表格中显示不正确; 所有节点(父节点和子节点)都在第一级。

我指定我使用的是SAPUI5版本:最新的1.66.1。

我已经在xml视图中声明了表格,如下所示:

rows =" {path:'/',parameters:{

countMode:'Inline'

treeAnnotationProperties:{

architectureLevelFor:'HierarchyLevel',

architectureNodeFor:" NodeID",

architectureParentNodeFor:" ParentNodeID",

architectureDrillStateFor:" DrillState"}}}">

在controller.js中声明的JSON文件:

sap.ui.define([" ./BaseController"," sap/ui/model/json/JSONModel"," ../model/formatter"," sap/ui/model/Filter"," sap/ui/model/FilterOperator"],函数(BaseController,JSONModel,格式化程序,Filter,FilterOperator){"使用严格";返回BaseController.extend(" t.tree.controller.Worklist",{格式化程序:formatter,/*

onInit:函数(){

var oViewModel,iOriginalBusyDelay,

oTable = this.byId(" table");

var data = [

{" NodeID":1,

" HierarchyLevel":0,

"说明":" 1",

" ParentNodeID":null,

" DrillState":"展开"},

{" NodeID":2

" HierarchyLevel":0,

"说明":" 2",

" ParentNodeID":空,

" DrillState":"展开"},

{" NodeID":3,

" HierarchyLevel":0,

"说明":" 3",

" ParentNodeID":null,

" DrillState":"展开"},

{" NodeID":4

" HierarchyLevel":1,

"说明":" 1.1",

" ParentNodeID":1

" DrillState":"叶"},

{" NodeID":5

" HierarchyLevel":1,

"说明":" 1.2",

" ParentNodeID":1

" DrillState":"展开"},

{" NodeID":6,

" HierarchyLevel":2,

"说明":" 1.2.1",

" ParentNodeID":5

" DrillState":"叶子"},

{" NodeID":7,

" HierarchyLevel":2,

"说明":" 1.2.2",

" ParentNodeID":5,

" DrillState":"叶"},

{" NodeID":8,

" HierarchyLevel":1,

"说明":" 2.1",

" ParentNodeID":2,

" DrillState":"叶子"},

{" NodeID":9,

" HierarchyLevel":1,

"说明":" 2.2",

" ParentNodeID":2,

" DrillState":"叶子"},

{" NodeID":10,

" HierarchyLevel":1,

"说明":" 2.3",

" ParentNodeID":2,

" DrillState":"叶"},

{" NodeID":11,

" HierarchyLevel":1,

"说明":" 3.1",

" ParentNodeID":3,

" DrillState":"展开"},

{" NodeID":12

" HierarchyLevel":2,

"说明":" 3.1.1",

" ParentNodeID":11

" DrillState":"展开"},

{" NodeID":13,

" HierarchyLevel":3,

"说明":" 3.1.1.1",

" ParentNodeID":12,

" DrillState":"叶"},

{" NodeID":14

" HierarchyLevel":3,

"说明":" 3.1.1.2",

" ParentNodeID":12,

" DrillState":"叶"},

{" NodeID":15,

" HierarchyLevel":3,

"说明":" 3.1.1.3",

" ParentNodeID":12

" DrillState":"叶子"},

{" NodeID":16

" HierarchyLevel":3,

"说明":" 3.1.1.4",

" ParentNodeID":12,

" DrillState":" leaf"}];

var nodesModel = new sap.ui.model.json.JSONModel(); nodesModel.setData(data); this.getView()。setModel(nodesModel); }

非常感谢您

雷纳塔

         点击此处--->   EasySAP.com群内免费提供SAP练习系统(在群公告中)

加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)


大家好,

我在sap.ui.table树表中绑定时遇到一些问题。 该树结构在表格中显示不正确; 所有节点(父节点和子节点)都在第一级。

我指定我使用的是SAPUI5版本:最新的1.66.1。

我已经在xml视图中声明了表格,如下所示:

rows =" {path:'/',parameters:{

countMode:'Inline'

treeAnnotationProperties:{

architectureLevelFor:'HierarchyLevel',

architectureNodeFor:" NodeID",

architectureParentNodeFor:" ParentNodeID",

architectureDrillStateFor:" DrillState"}}}">

在controller.js中声明的JSON文件:

sap.ui.define([" ./BaseController"," sap/ui/model/json/JSONModel"," ../model/formatter"," sap/ui/model/Filter"," sap/ui/model/FilterOperator"],函数(BaseController,JSONModel,格式化程序,Filter,FilterOperator){"使用严格";返回BaseController.extend(" t.tree.controller.Worklist",{格式化程序:formatter,/*

onInit:函数(){

var oViewModel,iOriginalBusyDelay,

oTable = this.byId(" table");

var data = [

{" NodeID":1,

" HierarchyLevel":0,

"说明":" 1",

" ParentNodeID":null,

" DrillState":"展开"},

{" NodeID":2

" HierarchyLevel":0,

"说明":" 2",

" ParentNodeID":空,

" DrillState":"展开"},

{" NodeID":3,

" HierarchyLevel":0,

"说明":" 3",

" ParentNodeID":null,

" DrillState":"展开"},

{" NodeID":4

" HierarchyLevel":1,

"说明":" 1.1",

" ParentNodeID":1

" DrillState":"叶"},

{" NodeID":5

" HierarchyLevel":1,

"说明":" 1.2",

" ParentNodeID":1

" DrillState":"展开"},

{" NodeID":6,

" HierarchyLevel":2,

"说明":" 1.2.1",

" ParentNodeID":5

" DrillState":"叶子"},

{" NodeID":7,

" HierarchyLevel":2,

"说明":" 1.2.2",

" ParentNodeID":5,

" DrillState":"叶"},

{" NodeID":8,

" HierarchyLevel":1,

"说明":" 2.1",

" ParentNodeID":2,

" DrillState":"叶子"},

{" NodeID":9,

" HierarchyLevel":1,

"说明":" 2.2",

" ParentNodeID":2,

" DrillState":"叶子"},

{" NodeID":10,

" HierarchyLevel":1,

"说明":" 2.3",

" ParentNodeID":2,

" DrillState":"叶"},

{" NodeID":11,

" HierarchyLevel":1,

"说明":" 3.1",

" ParentNodeID":3,

" DrillState":"展开"},

{" NodeID":12

" HierarchyLevel":2,

"说明":" 3.1.1",

" ParentNodeID":11

" DrillState":"展开"},

{" NodeID":13,

" HierarchyLevel":3,

"说明":" 3.1.1.1",

" ParentNodeID":12,

" DrillState":"叶"},

{" NodeID":14

" HierarchyLevel":3,

"说明":" 3.1.1.2",

" ParentNodeID":12,

" DrillState":"叶"},

{" NodeID":15,

" HierarchyLevel":3,

"说明":" 3.1.1.3",

" ParentNodeID":12

" DrillState":"叶子"},

{" NodeID":16

" HierarchyLevel":3,

"说明":" 3.1.1.4",

" ParentNodeID":12,

" DrillState":" leaf"}];

var nodesModel = new sap.ui.model.json.JSONModel(); nodesModel.setData(data); this.getView()。setModel(nodesModel); }

非常感谢您

雷纳塔

付费偷看设置
发送

一周热门 更多>