Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
535 views
in Technique[技术] by (71.8m points)

SAPUI5 Smartchart binding using CDs views with parameters

In my XML view I have used Smartcharts with CDs views entityset and it was working as per the requirement.

enter image description here

Output

enter image description here

As per the new requirement, need to enable the parameters to the CDs views to reduce the amount of load for the given entityset.

I have tried Smartchart beforeRebindChart event for applying the missing parameters.

smartChartBeforeRebind: function (oEvent) { 
    var oBindingParams = oEvent.getParameter("bindingParams");
    oBindingParams.parameters = { "entitySet": "Z****_SERV1" };
    var aFilters = [];
    aFilters.push(new sap.ui.model.Filter("***den", sap.ui.model.FilterOperator.EQ, "ALL"));
    oBindingParams.filters = aFilters;    
    oBindingParams.events.dataRequested = (oEvent) => {
        console.log("oBindingParams.events.dataRequested: ", oEvent);
    }
    oBindingParams.events.dataRecevied = (oEvent) => {
        console.log("oBindingParams.events.dataRecevied: ", oEvent);
    }
},

After applying the filters to the entityset the Smartcharts are not loading. An empty tile is loaded without chart. Is there any way I can apply filters/parameters to the Smartchart?

I am using oData V2 version and project is created using SAP BAS.

question from:https://stackoverflow.com/questions/66060124/sapui5-smartchart-binding-using-cds-views-with-parameters

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...