cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamically display the table data in SAPUI5 in XML View

former_member222346
Participant
0 Kudos
373

Hi Folks,

I created a table with 12 columns and 3 rows. The data will be fetched from oData service Url.

My requirement is "All the columns should be displayed but the rows should be displayed wrt the User"

My table looks like

Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec

UK

ET

GT

Now, UK, ET and GT should be displayed dynamically. Some users can see only UK, some can see only ET etc.. in all probabilities.

Help me out in solving this.

Regards,

Sindhu

Accepted Solutions (0)

Answers (1)

Answers (1)

irfan_gokak
Contributor
0 Kudos

Hi Sindhuja,

You can use below function and inside that function apply filters based on type of user. Use below reference code. Hope this will help.

oTable.attachEventOnce("updateFinished", function(oEvent){
	if(usertype == "<value>"){
          var oFilter1 = new Filter("<Param>", sap.ui.model.FilterOperator.Contains, "UK");
          var oFilter2 = new Filter("<Param>", sap.ui.model.FilterOperator.Contains, "GT");
	  var oBinding = this.getBinding("items");
	  oBinding.filter(new sap.ui.model.Filter([oFilter1,oFilter2], false));
        }
});