A very simple question of serverFiltering. - Forum - Mobile - Progress Community

A very simple question of serverFiltering.

 Forum

A very simple question of serverFiltering.

This question is answered

A very simple question of serverFiltering.

I have configured a service:

88.113.172.165:8810/.../ynimike < '011169046'"}

This uses "serverFiltering".  When I run this URI, I can see from promon:

 Record Reads           35

- - -

With a very simple Telerik Kendo UI example (based on Progress Data Service-template):

this.jsdoDataSource = new kendo.data.DataSource({
                        type: "jsdo",
                        // TO_DO - Enter your filtering and sorting options
                        serverPaging: true,
                        serverFiltering: true,
                        serverSorting: true,
                        filter: { field: "yn_nimike", operator: "gt", value: "011169046" },
                        //sort: [ { field: "Name", dir: "desc" } ],
                        transport: {
                            jsdo: this.jsdoModel
                            // TO_DO - If resource is multi-table dataset, specify table name for data source
                            //, tableRef: jsdoSettings.tableName
                        },

When I run this program, filtering is done at client side, because promon shows:

 Record Reads       126262

What is wrong?

Regards

- teppo

Verified Answer
  • Hello Teppo,

    A quick reply.

    I am guessing that since the pageSize has not been specified, you are getting all the records.

    What do you see on the Network tab in the Web Inspector?

    What is the URL sent to the server?

    What is the payload?

    I hope this helps.

    Edsel

All Replies
  • For client-side Filtering the client will need the unfiltered complete result set (all records).

    Server side Filtering can make use of index brackets.

    Architect of the SmartComponent Library and WinKit

    Consultingwerk Ltd.

  • Hello Teppo,

    A quick reply.

    I am guessing that since the pageSize has not been specified, you are getting all the records.

    What do you see on the Network tab in the Web Inspector?

    What is the URL sent to the server?

    What is the payload?

    I hope this helps.

    Edsel

  • I added

    pageSize: 20,

    Now it works!

    BTW: Where is this documented?

  • For the documentation on the Kendo UI DataSource, you can use the following link:

       docs.telerik.com/.../datasource

  • I have read this documentation, but I have not found that I need "pageSize" if I have defined "serverFiltering".  

  • You are right.

    The documentation is not clear regrading this usage.

    In addition to your point, i would have expected the documentation to also say that pageSize does not have a default value and when this value is not specified, all the records are read regardless of the serverPaging setting.

    I will pass this info along to the corresponding team.

    Thank you and regards.

  • Hello.
     
    And thank you.
     
    I think that the most valuable thing to increase Kendo UI users in the audience of OpenEdge developers is to offer more examples nad explanations.
     
    For instance when I build a simple login screen ("form"), I need to know how I easily check userid/password at the OpenEdge appserver side.  Very simple example, please.
     
    I can build a one field filter, but when I need more, ?.
     
    Regads
     
    - teppo
     
    ---------------------------|--------------------
    Teppo Määttänen____| TR-Tiimi Oy
    Consultant_________| Struerintie 1
    teppo @ trtiimi.fi____| 30100 FORSSA
    int-358-50-5748 226 | www.trtiimi.fi
    ---------------------------|--------------------
     
  • You are welcome.

    Many thanks for your feedback. It is appreciated.

    Yes, we need more examples.

    We only have a few examples specific to the JSDO:

       oemobiledemo.progress.com/

       github.com/.../sample-crud-app

    You can take a look at the examples for Kendo UI:

       demos.telerik.com/.../

    You can probably convert the examples using the Kendo UI DataSource to use the JSDO DataSource easily enough.

    In particular about building with more than one filter, you could take a look at the format used for the filter expression:

    docs.telerik.com/.../datasource

    Thank you.

    Kiitos.

    Edsel

  • Hello Teppo,

    I want to let you know I passed along you feedback on the documentation regarding paging.

    I learned that there was already a section where the need to specify pageSize with paging was documented:

       docs.telerik.com/.../walkthrough

    The team has also updated the documentation for the DataSource to mention this:

       docs.telerik.com/.../datasource

    Thank you for your feedback.

    Edsel

  • Hello.
     
    I think that serverPaging and serverFiltering should not be connected togerher at all.
     
    According to my experince - for instance in OpenEdge:
     
    Filtering means selecting rows based on selection criteria.  If there is “serverFiltering”, only the selected rows are moved to client side.  On “clientFiltering”, all rows are moved to client side, and rows are selected there for instance into a grid.
     
    Paging - according to my experince - means that all *selected* rows are not moved to client side in one batch but one page at a time.  The idea is to save time and recources.  This is how it works for instance in ADM2.
     
    Regards
     
    - teppo
     
    ---------------------------|--------------------
    Teppo Määttänen____| TR-Tiimi Oy
    Consultant_________| Struerintie 1
    teppo @ trtiimi.fi____| 30100 FORSSA
    int-358-50-5748 226 | www.trtiimi.fi
    ---------------------------|--------------------
     
  • The options serverPaging and serverFiltering work pretty much as the cases that you mentioned.

    You can use serverPaging = true by itself and you can use serverFiltering = true by itself as well.

    However, if you apply a filter when working with serverPaging = true, a client side filtering would only apply to the data that is available locally, i.e., the page.

    This result might not be what a user would expect.

    In most cases, when working with serverPaging = true, you would also want to use serverFiltering = true and serverSorting = true.

    I hope this helps.

  • Hello.
     
    I tested this case using example :
     
    this.jsdoDataSource = new kendo.data.DataSource({
         type: "jsdo",
         // TO_DO - Enter your filtering and sorting options
         // serverPaging: true,
         // pageSize: 10,
         // serverSorting: true,
         serverFiltering: true,
         filter: { field: "yn_nimike", operator: "gt", value: "0" },
         //sort: [ { field: "Name", dir: "desc" } ],
     
    As you can see - I have only set serverFiltering and filter.  From promon I can read that all records are brought from database:
     
    Record Reads       126297
     
    This is not correct, because I have defined "serverFiltering: true".  It should read from database only records that satsfy the filter criteria: "filter: { field: "yn_nimike", operator: "gt", value: "0" }".
     
    You should correct this as soon as possible.
     
    Regards
     
    - teppo
     
    ---------------------------|--------------------
    Teppo Määttänen____| TR-Tiimi Oy
    Consultant_________| Struerintie 1
    teppo @ trtiimi.fi____| 30100 FORSSA
    int-358-50-5748 226 | www.trtiimi.fi
    ---------------------------|--------------------
     
  • Hello Teppo,

    I noticed that your reply to your own question in the last post created another thread since the subject line of the email was different.

    I am adding a link to that thread in case that we need to reference to that thread from this one:

       community.progress.com/.../24125

    Thanks,

    Edsel