cancel
Showing results for 
Search instead for 
Did you mean: 

Client Side Filter on SAPUI5 Table

Former Member
0 Kudos

Hi All,

i have Created Table using SAPUI5 SDK - Demo Kit and for Data Binding i have Used My OData Service.

Filter at SAPUI5 SDK - Demo Kit is working fine  without any extra coding ,but its not working in my Case even though i am using same syntax .

i have checked Post in Google also Regarding Filter but all are Server Side Filter only, i am searching for Client side Filter .Please Help.

Thanks

Ashish

Accepted Solutions (1)

Accepted Solutions (1)

former_member182372
Active Contributor
0 Kudos

with vodatamodel v2 you can use

https://sapui5.netweaver.ondemand.com/sdk/#docs/api/symbols/sap.ui.model.odata.OperationMode.html

sap.ui.model.odata.OperationMode.ClientOperations are executed on the client, all entries must be avilable to be able to do so.




set defaultOperationMode to Client


https://sapui5.netweaver.ondemand.com/sdk/#docs/api/symbols/sap.ui.model.odata.v2.ODataModel.html

0 Kudos

Hi Maksim Rashchynski again ...

Regarding this post, when I change odatamodel to odataModel v2, I get this error:

"Uncaught TypeError: Cannot read property 'ODataModel' of undefined"

Any ideas ?

Thank you so much!

Answers (3)

Answers (3)

former_member183518
Active Participant

Adding to what maksim has suggested, you can even make it quite specific to the bindings with V2 oData Model.


oTable.bindRows({

   path: "/Product",

   parameters: {

      operationMode: "Client"

   }

});

karthikarjun
Active Contributor
0 Kudos

Hi Ashish,

I agree with Maksim and shakthi comment.

What is your case? What is your requirement?..Could you please elaborate

Thanks,

Karthik A

Former Member
0 Kudos

Hi Karthik,

i want to Filter my Table without Hitting Odata Service again for Filter , i want to use oData serivce only for First time to Load data , after i want to use work with Data which i have already loaded.

Thanks

Ashish

former_member182372
Active Contributor
0 Kudos

did you try OperationMode set to Client??

Former Member
0 Kudos

yes i  have Used still its not working, see my Code as below

var oModel = new sap.ui.model.odata.ODataModel("http://abc.technologies.com:8002/sap/opu/odata/SAP/ZEMP_REF_SRV",

  true,

  'p_abapdev', 'p_abapdev');

var userDetailsTable = new sap.ui.table.DataTable({

    title : "Employee Referral",

    width : "75%",

    visibleRowCount : 10,

    ExpandedVisibleRowCount : 20,

    selectionMode : sap.ui.table.SelectionMode.Single,

    editable : false

   

   });

   

  

    userDetailsTable.addColumn(new sap.ui.table.Column({

        label: new sap.ui.commons.Label({text: "Candidate Id"}),

        template: new sap.ui.commons.TextField().bindProperty("value", "CandiId"),

        sortProperty: "CandiId",

        filterProperty:"CandiId"

        }));

   

    userDetailsTable.addColumn(new sap.ui.table.Column({

        label: new sap.ui.commons.Label({text: "Application Id"}),

        template: new sap.ui.commons.TextField().bindProperty("value", "AppId"),

        sortProperty: "AppId",

        filtered   : true}));

   

    userDetailsTable.addColumn(new sap.ui.table.Column({

        label: new sap.ui.commons.Label({text: "Requisition Id"}),

        template: new sap.ui.commons.TextField().bindProperty("value", "ReqId"),

        sortProperty: "ReqId",

        filtered   : true}));

    userDetailsTable.addColumn(new sap.ui.table.Column({

        label: new sap.ui.commons.Label({text: "Job Posting Id"}),

        template: new sap.ui.commons.TextField().bindProperty("value", "PostingId"),

        sortProperty: "PostingId",

        width : '120px',

        filtered   : true,

        autoResizable : true   

    }));

    

     userDetailsTable.bindRows({path:"/EmployeeSet",

      parameters:{

      operationMode: "Client" 

      }});

userDetailsTable.placeAt('content');

   

Thanks

Ashish

former_member183518
Active Participant
0 Kudos

This won't work without using v2 odata model which is already specified in the previous answers.

new sap.ui.model.odata.v2.ODataModel("<url>");
Former Member
0 Kudos

Thanks A Lot for your Help.

Former Member
0 Kudos

Hey,

Can you please share the links what's written about the filters on the google that said all filters on server side - not client side.

Please, check  the insterted text that i clipped from Models - UI Development Toolkit for HTML5 (SAPUI5) - SAP Library.