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
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
For client-side Filtering the client will need the unfiltered complete result set (all records).
Server side Filtering can make use of index brackets.
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:
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.
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:
github.com/.../sample-crud-app
You can take a look at the examples for Kendo UI:
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
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 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