Select first row javascript affects wrong grid

3 posts, 0 answers
  1. Greg
    Greg avatar
    35 posts
    Member since:
    Sep 2013

    Posted 07 Jan 2016 Link to this post

    I have a View with a Kendo TabStrip containing multiple grids on multiple panels. On one grid, I need to select the first row after loading data. I'm trying to do this with:

    function publicUsersGridDataBound() {
      // Select the first row.
      var grid = $('#publicUsersGrid').data('kendoGrid');


    This works when publicUsersGrid is the only grid on the View.

    When I add more grids,"tr:eq(1)");

    results in the first row in the first grid getting selected, not the first row in publicUsersGridDataBound, even though when I debug the javascript function, the line

    var grid = $('#publicUsersGrid').data('kendoGrid');

    gets a reference to the correct grid.

    I'm stumped.


  2. Dimiter Topalov
    Dimiter Topalov avatar
    1047 posts

    Posted 08 Jan 2016 Link to this post

    Hello Greg,

    This problem is already solved and the fix will be available with the Q1 2016 release, scheduled for next week. Meanwhile, you can use the following workaround:

    var grid2 = $("#grid-2").data("kendoGrid");

    Be aware that when using tbody, the data table rows indexes are zero-based, i.e. the above code will select the second data row, not the first one.

    I hope this helps.

    Dimiter Topalov
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. Greg
    Greg avatar
    35 posts
    Member since:
    Sep 2013

    Posted 08 Jan 2016 in reply to Dimiter Topalov Link to this post

    Thanks. Your alternate code works.
Back to Top