Skip to Content

Server Model How to Filter and Sort within Client

Experts,

Created Server model for table display. Initial load looks good and it has got 1000+ rows.

Now requirement is to Filter and Sort loaded data. Since Filtering and Sorting need to be done within table any possibilities to avoid Odata call to back end? So basically within Client since getModel() got data i think if Filtering and sorting will improve performance of App....

Since it's BW query running in background oData call anywhere takes 20 seconds and more.

Any thoughts?

I did like this...But not working...

oTable.getBinding("items").sOperationMode = "Client";

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

6 Answers

  • Posted on Mar 11 at 09:53 AM

    Try setting useclientmode to true.

    oTable.getBinding("items").useClientMode = true;

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Mar 11 at 10:03 AM

    Hi,

    Take a look at this example:

    Samples - Grid Table - Sorting

    The sample uses JSONModel for table items, no request to server will be made.

    Retrieved data from ODataModel can be set to JSONModel with setData() method.

    Regards,

    Peter

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Mar 11 at 12:46 PM

    Just build JSON way but data not getting into View. Can you help what am i doing wrong?


    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Mar 12 at 03:54 AM

    Declare oModel as Odata Model...Read from Backend using Read Function.

    In Success function, bind oData received to JSON Model. setData{ zmrktseg: oData-results }

    Then bind JSONModel to View.

    this.getView().setModel(oJSONModel)...Here you go..

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Mar 12 at 03:05 PM

    Yes....init also...

    But my requirement was different...Based on action table should reload...Anyways in init as well as i do have JSON binding from OData.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Mar 13 at 06:25 AM

    I am using Responsive Table since requirement involves Mobile Interface as well. I will check on Sorting in Grid Table...

    Also i have a new issue...can you please help here

    https://answers.sap.com/questions/13002442/jsonmodel-how-to-identify-changes-done-to-table.html

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.