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

About cellIndex property on the grid with locked columns

3 Answers 52 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Wanchang
Top achievements
Rank 1
Wanchang asked on 31 Oct 2016, 12:50 AM

Hi,

I use cellIndex property on the grid. But it returns strange value when the grid has locked columns.

I tried the propety on the Frozen columns demo page using Google Chrome Developer Tools.

  1. When I click "Order ID" cell at the first row and input $("#grid").data("kendoGrid").cellIndex($0) to the console, it returns 2.
  2. When I click "Ship Name" cell at the first row and input $("#grid").data("kendoGrid").cellIndex($0) to the console, it returns 3.
  3. When I click "Ship Country" cell at the first row and input $("#grid").data("kendoGrid").cellIndex($0) to the console, it returns 2.
  4. When I click "Ship City" cell at the first row and input $("#grid").data("kendoGrid").cellIndex($0) to the console, it returns 3.
  5. When I click "ShipAddress" cell at the first row and input $("#grid").data("kendoGrid").cellIndex($0) to the console, it returns 4.

I expect in above case 1 cellIndex returns 0, and in case 2 cellIndex returns 1.

Is this the correct behavior of cellIndex property?

When I click "Ship Name" cell at the first row and input $("#grid").data("kendoGrid").cellIndex($0) to the console, it returns 3.
When I click "Ship Name" cell at the first row and input $("#grid").data("kendoGrid").cellIndex($0) to the console, it returns 3.

3 Answers, 1 is accepted

Sort by
0
Wanchang
Top achievements
Rank 1
answered on 31 Oct 2016, 01:01 AM

I also tried to change groupable property to false at Dojo.

But the result didn't change.

0
Accepted
Dimiter Topalov
Telerik team
answered on 01 Nov 2016, 08:31 AM
Hi Kiriya,

Thank you for bringing this issue to our attention. Your observations are correct. The issue is caused by the fact that when there are locked columns, the argument, passed to the cellIndex() method, should be wrapped in a jQuery object, e.g. ...cellIndex($($0)).

The documentation for the cellIndex() method will be upgraded accordingly.

Regards,
Dimiter Topalov
Telerik by Progress
Build rich, delightful, *native* Angular 2 apps with Kendo UI for Angular 2. Try it out today! Kendo UI for Angular 2 (currently in beta) is a jQuery-free toolset, written in TypeScript, designed from the ground up to offer true, native Angular 2 components.
0
Wanchang
Top achievements
Rank 1
answered on 02 Nov 2016, 04:37 AM

Thanks for your reply. I implemented the workaround and solved this issue.

But when I clicked the "Mark as answered" hyperlink, http 500 error occurred.

So I can't mark my question as answered.

Tags
Grid
Asked by
Wanchang
Top achievements
Rank 1
Answers by
Wanchang
Top achievements
Rank 1
Dimiter Topalov
Telerik team
Share this question
or