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

multi selected data move to top

1 Answer 84 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Austin
Top achievements
Rank 1
Austin asked on 20 Sep 2016, 04:01 AM

In the sample code have a filter button where i would like to bring the selected data to the top of the grid.

example: i have select [1,3,5]

output of the grid view:[1,3,5,2,4]

Sample code

1 Answer, 1 is accepted

Sort by
0
Boyan Dimitrov
Telerik team
answered on 21 Sep 2016, 02:09 PM

Hello Austin,

This functionality is not really a filtering, but it is rather reordering items. The easiest way to achieve this is by passing a new array of data to the DataSource associated with the grid. The items in this array should be ordered in the same way as they are selected by the user. 

  - the select method (with no parameters) of the Kendo UI Grid gets the table rows (or cells) which are selected. In order to get a data item associated with a specific table row element the dataItem method of the Kendo UI Grid should be used. 

  - when the array is ordered you can pass it to the data method of the Kendo UI DataSource. 

Regards,
Boyan Dimitrov
Telerik by Progress
 
Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
 
Tags
Grid
Asked by
Austin
Top achievements
Rank 1
Answers by
Boyan Dimitrov
Telerik team
Share this question
or