Skip to Content
avatar image
Former Member

Dynamically display the table data in SAPUI5 in XML View

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Nov 20, 2017 at 09:31 AM

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