This is a migrated thread and some comments may be shown as answers.

Select all in Virtual Remote Data grid

1 Answer 92 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ed
Top achievements
Rank 1
Ed asked on 28 Jul 2014, 06:40 PM
On my grid, I have a column that contains a checkbox (in addition to having selectable=multiple).  In the header of the checkbox columns, I have a checkbox with "select/deselect all" as the header text.  The grid also has virtual, remote data paging.

I am using the standard way of getting the selected rows - select().

When I click on the CheckAll checkbox, I'm guessing the best way to approach this is to get all the remote data on the client and select all the rows on dataBound.  Does this make sense or is there another way to approach this?

If I do need to get all the rows from the server, I don't want to get the rows that are already on the client.  How can I instruct Kendo to get all rows, except for those that are already on the client - or if that's really not realistic, how do I instruct Kendo to get all rows?  Would I just update the dataSource and set the pageSize to the total number of records and do a dataSource.read()?

Thanks,
--Ed

1 Answer, 1 is accepted

Sort by
0
Accepted
Alexander Valchev
Telerik team
answered on 30 Jul 2014, 07:53 AM
Hello Ed,

Usually the virtualization and serverPaging are used when a large data set has to be displayed. I would not recommend retrieving all the data on the client as this is likely to cause performance issues.

If your aim is to mark the records as selected on the server, you may send a standard jQuery.ajax request to the server when "select/deselect all" checkbox is changed.

How can I instruct Kendo to get all rows, except for those that are already on the client - or if that's really not realistic, how do I instruct Kendo to get all rows?  Would I just update the dataSource and set the pageSize to the total number of records and do a dataSource.read()?

Yes this is a valid approach, however once again I recommend not getting all the records on the client.

Regards,
Alexander Valchev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
Ed
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Share this question
or