multi selected data move to top

2 posts, 0 answers
  1. Austin
    Austin avatar
    8 posts
    Member since:
    Sep 2016

    Posted 19 Sep 2016 Link to this post

    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

  2. Boyan Dimitrov
    Boyan Dimitrov avatar
    2031 posts

    Posted 21 Sep 2016 Link to this post

    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. 

    Boyan Dimitrov
    Telerik by Progress
    Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
Back to Top