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

[Solved] Select row by datakey

1 Answer 75 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Bruno
Top achievements
Rank 1
Bruno asked on 25 Jul 2011, 11:18 PM
Is there by any chance an easier way to select a row by the datakey?

Thanks for the help

/**
   * Select a row in the grid
   */
   function selectRowById(id) {
       var grid = $("#MitarbeiterGrid").data("tGrid");
       $.each(grid.data, function (index, value) {
           if (value.MitarbeiterId == id) {
               // select row                
               if (grid.$rows()[index].className == "t-alt") {
                   grid.$rows()[index].className = "t-alt t-state-selected";
               } else {
                   grid.$rows()[index].className = "t-state-selected";
               }
           }
       });
   }

1 Answer, 1 is accepted

Sort by
0
Ross Micheals
Top achievements
Rank 1
answered on 12 Jan 2012, 03:10 AM
Not an answer, but a request for one. :)
Tags
Grid
Asked by
Bruno
Top achievements
Rank 1
Answers by
Ross Micheals
Top achievements
Rank 1
Share this question
or