Is there a smart way of changing the server-side paging beha

Posted by Ruben Dröge on 15-Jul-2019 09:18

Our customer has build a KUIB-app that uses server-side filtering and paging. However, they don't use the 'count' function that is sort of prescriptive in the JSDO approach of things. Still, a count operation (and therefore a PUT request) is send to the server every single time, that they actually don't need.

Their end-user is blocking all PUT requests, so they see a lot of errors and concerns from them.
What would be the place to adjust the behavior of the server-side paging calls from the Kendo UI for Angular components data source?

We want to adjust the paging behavior of those components (the server-side calls), because we get all information we need from the response that we get when we execute the first GET request.

All Replies

Posted by egarcia on 15-Jul-2019 15:27

Hello Ruben,

The prescriptive approach to support server-side filtering and paging is to use the JFP and specify a count function.

However, you can provide your own mapping plugin to implement your own logic for server-side filtering and paging.

If you do not need to invoke a count function, then you can set transport.countFnName to undefined so that this logic is not called.

If you have enabled server-side operations via Kendo UI Builder (by turning off Client-Side Operations), the code is expecting a function and will error out if the Count Function field is left blank. It will be interpreted as "" instead of undefined.

Here are a couple of approaches.

A possible workaround here would be to programmatically override the Data Source options and set countFnName to be undefined.

Another alternative, would be to set the Count Function to a function that is local in the JSDO, add it dynamically to the JSDO so that when it is called, the call is done on the client, rather than calling a function on the server (avoiding using PUT). You would need to make sure that the function returns a Promise so it can work as a replacement of the invoke count operation.

Please let me know if you need more details on either approach.

Considering that you are using your own implementation for the calculation of the count, you may want to use the server.count property with a custom mapping plugin so that Kendo UI knows the value for the count.

See the following link for info:

- documentation.progress.com/.../index.html

I hope this helps.

Posted by george.ene on 17-Jul-2019 10:56

Hello,

We solved the issue by applying egarcias suggestion: " programmatically override the Data Source options and set countFnName to be undefined".

Thank you for the help.

Posted by george.ene on 17-Jul-2019 10:58

Hello,

We have applied egarcias suggestion "programmatically override the Data Source options and set countFnName to be undefined" and it has solved the issue.

Thank you for the help.

This thread is closed