A very simple question of serverFiltering.

Posted by teppo_55 on 29-Mar-2016 02:47

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

Posted by egarcia on 29-Mar-2016 03:46

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

Posted by Mike Fechner on 29-Mar-2016 03:41

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

Server side Filtering can make use of index brackets.

Posted by egarcia on 29-Mar-2016 03:46

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

Posted by teppo_55 on 29-Mar-2016 04:22

I added

pageSize: 20,

Now it works!

BTW: Where is this documented?

Posted by egarcia on 29-Mar-2016 04:46

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

   docs.telerik.com/.../datasource

Posted by teppo_55 on 29-Mar-2016 04:52

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

Posted by egarcia on 29-Mar-2016 06:00

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.

Posted by teppo_55 on 29-Mar-2016 06:14

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
---------------------------|--------------------
 

Posted by egarcia on 29-Mar-2016 17:30

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

Posted by egarcia on 31-Mar-2016 06:08

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

Posted by teppo_55 on 31-Mar-2016 06:34

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
---------------------------|--------------------
 

Posted by egarcia on 01-Apr-2016 06:06

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.

Posted by teppo_55 on 04-Apr-2016 01:24

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
---------------------------|--------------------
 

Posted by egarcia on 04-Apr-2016 16:44

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

This thread is closed