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

Issue with grid.editCell() and locked columns

4 Answers 289 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ian
Top achievements
Rank 1
Ian asked on 29 Apr 2016, 05:24 PM

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

4 Answers, 1 is accepted

Sort by
0
Accepted
Kiril Nikolov
Telerik team
answered on 03 May 2016, 07:38 AM
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!
 
0
Ian
Top achievements
Rank 1
answered on 03 May 2016, 05:28 PM

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.

0
Ian
Top achievements
Rank 1
answered on 03 May 2016, 06:36 PM

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)"));

0
Kiril Nikolov
Telerik team
answered on 04 May 2016, 07:21 AM
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!
 
Tags
Grid
Asked by
Ian
Top achievements
Rank 1
Answers by
Kiril Nikolov
Telerik team
Ian
Top achievements
Rank 1
Share this question
or