Skip to Content
0

Dynamically display the table data in SAPUI5 in XML View

Nov 20, 2017 at 07:55 AM

40

avatar image
Former Member

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Irfan Gokak Nov 20, 2017 at 09:31 AM
0

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));
        }
});
Share
10 |10000 characters needed characters left characters exceeded