I have a grid with endless scrolling. I want to load filtered rows to the grid. Any other operation shoud be performed on the client side.
I expect the grid will send a request only on a first grid loading and when I set a new filter.
Sorting, grouping, paging should be done on a client side.
BUT when I scroll down my grid endless scrolling is activating and grid sends a request to the server even if I set serverPaging to false.
My source code:
01.
function
loadGrid(profile) {
02.
$(
"#Grid"
).kendoGrid({
03.
dataSource: dataSource(profile),
04.
columns: profile.Columns ? JSON.parse(profile.Columns) : [],
05.
scrollable: {
06.
endless:
true
07.
},
08.
pageable: {
09.
numeric:
false
,
10.
previousNext:
false
11.
},
12.
groupable:
true
,
13.
sortable: {
14.
mode:
"multiple"
,
15.
allowUnsort:
true
,
16.
showIndexes:
true
17.
},
18.
filterable: {
19.
mode:
"row"
20.
},
21.
selectable:
"multiple cell"
,
22.
navigatable:
true
,
23.
resizable:
true
,
24.
reorderable:
true
,
25.
columnMenu: {
26.
filterable:
false
27.
}
28.
});
29.
}
30.
31.
function
dataSource(profile) {
32.
return
new
kendo.data.DataSource({
33.
type:
"webapi"
,
34.
pageSize: 50,
35.
transport: {
36.
read: {
37.
url:
"BI"
,
38.
type:
"POST"
39.
}
40.
},
41.
group: JSON.parse(profile.Groups),
42.
sort: JSON.parse(profile.Sortings),
43.
filter: JSON.parse(profile.Filters),
44.
serverFiltering:
true
,
45.
serverPaging:
false
,
46.
serverSorting:
false
,
47.
serverGrouping:
false
,
48.
serverAggregates:
false
49.
});
50.
}
8 Answers, 1 is accepted
Thank you for the provided information.
Please have in mind that all of the operations have to be done either on the server and on the client as otherwise additional requests or unexpected issues can occur.
More details can be found in the documentation:
https://docs.telerik.com/kendo-ui/framework/datasource/overview#mixed-data-operations-mode
Let me know if you need additional information on this matter.
Regards,
Stefan
Progress Telerik
Hi Stefan,
Thanks for the response.
I don't want to do the paging on the server side. I want to do the paging on the client side.
There is a bug in Telerik.
I set dataSource as below:
function dataSource(profile) {
return new kendo.data.DataSource({
type: "webapi",
pageSize: 50,
transport: {
read: {
url: "BI",
type: "POST"
}
},
group: JSON.parse(profile.Groups),
sort: JSON.parse(profile.Sortings),
filter: JSON.parse(profile.Filters),
serverFiltering: true,
serverPaging: false,
serverSorting: false,
serverGrouping: false,
serverAggregates: false
});
}
Once again, I set serverFiltering as true and everything else as false. And what happened? Telerik is sending a request when I want to load more rows, but serverPaging is set to false!
I do understand your point.
Currently, this is the expected result because of the following case, when the serverFiltering is set to true, the server will return only the data based on the filter criteria. Then when the user requests another page, the Grid will make a new request to the server to filter the data again based on the server information, as the server is set as the "single source of truth" when it comes to filtering. This is required as the data on the server could be changed from another place and the filter results could be different from the last filtering.
As we do understand that these scenarios could leave the impression that the Grid is not working correctly, we added the linked article to inform that this is expected and short example of why it is expected.
Apologies for the inconvenience this may have caused you.
Regards,
Stefan
Progress Telerik
Hi Stefan,
I can see your point here - however suppose we wanted to filter on the server and return all the data to the client in multiple pages for paging on the client - could this use case be supported in any way by the grid / data-source?
For example we are using Azure Table as a data source which doesn't support paging well in the conventional sense - so it could make sense to query the server with a filter and then return - all the rows (with some absolute limit) to the grid for client paging. This would also allow sorting of the data on the client.
Regards
Ian
Stefan,
I understand what you mean. Thanks for the details.
I tried a dozen combinations with serverPaging, serverFiltering, serverGrouping, sorting - eg. everything as true, some of them as true, and there is always at least one inconvenience. The main problem is the frontend is not merging the group headers, as on the attached screen (header ActivityType: MotoHours). I tried to load more rows (via endless scrolling) and the backend (server) is sending correct rows, but frontend duplicates the group header.
Regards
This is indeed an issue and I provided the link in the other ticket. I will share it here for better visibility as well:
https://github.com/telerik/kendo-ui-core/issues/3806
As for the Azure Tables scenario, I do understand that combining them could be beneficial in some scenarios, but in order to keep the behavior consistent, we recommend all of the operations to be set only on the client or on the server.
I do understand that this may not be ideal in all scenarios, but due to the scenarios described in the previous reply and in the linked post, for now, this is the supported approach.
Regards,
Stefan
Progress Telerik
Stefan,
My ticket has been closed, but there is still a bug!
My problem is not solved. Grouping does not work properly with remote data. I don't want to bind to the local data. This grid is in production, we are still waiting for the fix and your team decided to remove a Bug label from this ticket.
According to all documentation, we set all server operation properties to true:
serverFiltering: true,
serverPaging: true,
serverSorting: true,
serverGrouping: true,
serverAggregates: true
and the server is configured to group the items. We are using DataSourceResult.ToDataSourceResult(request) extension to return the JSON in controller. And there is still a bug with merging group headers.
I have re-opened the issue and the developer team will continue working on it.
We apologize for closing it before covering the scenario when the ToDataSource result method is used.
Regards,
Stefan
Progress Telerik