Issue with grid.editCell() and locked columns

5 posts, 1 answers
  1. Ian
    Ian avatar
    12 posts
    Member since:
    Feb 2016

    Posted 29 Apr 2016 Link to this post

    Hi. I'm having issues getting the grid.editCell() function when using a grid with locked  columns. 

    I have a grid where the first two columns are locked and I want to put the third column in edit mode. This third column is the first column of the unlocked section of the grid.

    For exaple, this works: grid.editCell($("#ddhsampintgrid tr:eq(" + (selectedIndex + 2) + ")").find("td:eq(0)"));

    and this works: grid.editCell($("#ddhsampintgrid tr:eq(" + (selectedIndex + 2) + ")").find("td:eq(1)"));

    but this does nothing: grid.editCell($("#ddhsampintgrid tr:eq(" + (selectedIndex + 2) + ")").find("td:eq(2)"));

    Any ideas on how to get this to work when using locked columns?

    Thanks,

    Ian

  2. Answer
    Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2596 posts

    Posted 03 May 2016 Link to this post

    Hi,

    Note that when frozen columns are used, the grid will create two separate tables one for the locked and one for the unlocked content. So please make sure that you select the right table, so you can place the cell in edit mode. Use your browser developer tools to inspect the DOM and see how the grid is structured as it should be helpful.

    Regards,
    Kiril Nikolov
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Ian
    Ian avatar
    12 posts
    Member since:
    Feb 2016

    Posted 03 May 2016 in reply to Kiril Nikolov Link to this post

    Thanks but your advice was not very helpful.

    Can you please provide an example of the selector I'd need to access the cell? It is difficult because I can't simply reference it by ID since there is none on the unlocked section.

    I have attached a screenshot of the cell I am trying to select.

  4. Ian
    Ian avatar
    12 posts
    Member since:
    Feb 2016

    Posted 03 May 2016 Link to this post

    I was able to get it working using the following line:

    grid.editCell($(".k-grid-content").find("table").find("tbody").find("tr:eq(" + (selectedIndex + 1) + ")").find("td:eq(0)"));

  5. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2596 posts

    Posted 04 May 2016 Link to this post

    Hello,

    I am happy to hear that the issue is resolved.

    In case you have any further questions do not hesitate to contact us.

    Regards,
    Kiril Nikolov
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
Back to Top