【sapui5】Control.Vizframe替换数据

2020-08-29 08:25发布

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

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


我遇到了问题。

我想在按下主列表时在详细信息页面上显示条形图。

但是,详细信息页面上显示的图表包含Entityset中的所有数据。

如何仅显示所选数据?

请告诉我。

致谢

 

 


 
 
 
 
 <项目>
 
 <内容>
 
 
 
 
 
 
 
 

 
 <项目>
 
 


 
 

 


 
  
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 


 


 


 
 

/*全球位置*/
 sap.ui.define([
 " test2/test2/controller/BaseController",
 " sap/ui/model/json/JSONModel"
 ],函数(BaseController,JSONModel){
 "使用严格";
 return BaseController.extend(" test2.test2.controller.Data",{
 onInit:函数(){
 this.getOwnerComponent()。getRouter()。getRoute(" dataget")。attachPatternMatched(this._onRouteMatched,this);
 },
 _onRouteMatched:函数(oEvent){
 this._bukrs = oEvent.getParameter(" arguments")。bukrs;


 var oModel = this.getModel();
 var sPath = oModel.createKey(" Meetups",{
 bukrs:this._bukrs});

 this.getView()。bindElement("/" + sPath);

 var oVizFrame = this.getView()。byId(" idVizFrame");


//↓如何编写此代码??↓
                        oVizFrame.getDataset()。setValue(this._bukrs);
            
 }


 });
 });
 

 [{
 " bukrs":" ZT01",
 "代码":1,
 " cname":" Acom",
 " div":" 1",
 " jan":11,
 " feb":12,
 " mar":13,
 " apr":14,
 "可能":15,
 " jun":16,
 " jul":17,
 " aug":18,
 " sep":19,
 " oct":20,
 " nov":21,
 " dec":22,
 " itm":5
 },
 {
 " bukrs":" ZT02",
 "代码":2,
 " cname":" Bcom",
 " div":" 2",
 " jan":23,
 " feb":24,
 " mar":25,
 " apr":26,
 "可能":27,
 " jun":28,
 " jul":29,
 " aug":30,
 " sep":31,
 " oct":32,
 " nov":33,
 " dec":34,
 " itm":10
 },
 {
 " bukrs":" ZT03",
 "代码":3,
 " cname":" Ccom",
 " div":" 1",
 " jan":35,
 " feb":36,
 " mar":37,
 " apr":38,
 "可能":39,
 " jun":40,
 " jul":41,
 " aug":42,
 " sep":43,
 " oct":44,
 " nov":45,
 " dec":46,
 " itm":15
 },
 {
 " bukrs":" ZT04",
 "代码":4,
 " cname":" Dcom",
 " div":" 2",
 " jan":47,
 " feb":48,
 " mar":49,
 " apr":50,
 "可能":51,
 " jun":52,
 " jul":53,
 " aug":54,
 " sep":55,
 " oct":56,
 " nov":57,
 " dec":58,
 " itm":20
 }
 ]
 

(47.4 kB)

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

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


我遇到了问题。

我想在按下主列表时在详细信息页面上显示条形图。

但是,详细信息页面上显示的图表包含Entityset中的所有数据。

如何仅显示所选数据?

请告诉我。

致谢

 

 


 
 
 
 
 <项目>
 
 <内容>
 
 
 
 
 
 
 
 

 
 <项目>
 
 


 
 

 


 
  
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 


 


 


 
 

/*全球位置*/
 sap.ui.define([
 " test2/test2/controller/BaseController",
 " sap/ui/model/json/JSONModel"
 ],函数(BaseController,JSONModel){
 "使用严格";
 return BaseController.extend(" test2.test2.controller.Data",{
 onInit:函数(){
 this.getOwnerComponent()。getRouter()。getRoute(" dataget")。attachPatternMatched(this._onRouteMatched,this);
 },
 _onRouteMatched:函数(oEvent){
 this._bukrs = oEvent.getParameter(" arguments")。bukrs;


 var oModel = this.getModel();
 var sPath = oModel.createKey(" Meetups",{
 bukrs:this._bukrs});

 this.getView()。bindElement("/" + sPath);

 var oVizFrame = this.getView()。byId(" idVizFrame");


//↓如何编写此代码??↓
                        oVizFrame.getDataset()。setValue(this._bukrs);
            
 }


 });
 });
 

 [{
 " bukrs":" ZT01",
 "代码":1,
 " cname":" Acom",
 " div":" 1",
 " jan":11,
 " feb":12,
 " mar":13,
 " apr":14,
 "可能":15,
 " jun":16,
 " jul":17,
 " aug":18,
 " sep":19,
 " oct":20,
 " nov":21,
 " dec":22,
 " itm":5
 },
 {
 " bukrs":" ZT02",
 "代码":2,
 " cname":" Bcom",
 " div":" 2",
 " jan":23,
 " feb":24,
 " mar":25,
 " apr":26,
 "可能":27,
 " jun":28,
 " jul":29,
 " aug":30,
 " sep":31,
 " oct":32,
 " nov":33,
 " dec":34,
 " itm":10
 },
 {
 " bukrs":" ZT03",
 "代码":3,
 " cname":" Ccom",
 " div":" 1",
 " jan":35,
 " feb":36,
 " mar":37,
 " apr":38,
 "可能":39,
 " jun":40,
 " jul":41,
 " aug":42,
 " sep":43,
 " oct":44,
 " nov":45,
 " dec":46,
 " itm":15
 },
 {
 " bukrs":" ZT04",
 "代码":4,
 " cname":" Dcom",
 " div":" 2",
 " jan":47,
 " feb":48,
 " mar":49,
 " apr":50,
 "可能":51,
 " jun":52,
 " jul":53,
 " aug":54,
 " sep":55,
 " oct":56,
 " nov":57,
 " dec":58,
 " itm":20
 }
 ]
 

(47.4 kB)
付费偷看设置
发送
1条回答
SKY徐
1楼-- · 2020-08-29 08:42

尝试以下操作:

1。 拾取vizframe实例并将其分配给

 var chart = sap.ui.getCore()。byId(" idVizFrame")

2之类的变量。 通过调用

 var chartDataset = chart.getDataset()

3,拾取数据集的边界并将其分配给变量。 现在执行

 chartDataset.bindAggregation(" data",{路径:"/img/Meetups",过滤器:[新sap.ui.model.Filter(" bukrs",sap.ui.model.FilterOperator。  EQ," ZT03")]})

,您可以在运行时将ZT03更新为该值。

一周热门 更多>