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

[Solved] onEdit - Column

2 Answers 46 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.
hugues viens
Top achievements
Rank 1
hugues viens asked on 14 Dec 2011, 08:37 AM
Hi,

I use the OnEdit event as described in the Client API :

The OnEdit event is raised when the user inserts or edits a grid row. The event argument exposes three fields:
  • dataItem - the JavaScript object to which the editor row is bound to. It is undefined during insertion.
  • mode - a string whose value is either "insert" or "edit"
  • form - the <form> DOM element which contains all editing components (textboxes, checkboxes, dropdownlists etc.)
  • cell - the <td> DOM element which goes in edit mode. This field is available only in cell edit mode.

The e.cell allows me to get the cell that triggered the OnEdit, is there a way to know which column triggered the event ?

2 Answers, 1 is accepted

Sort by
0
Nikolay Rusev
Telerik team
answered on 14 Dec 2011, 10:27 AM
Hello Hugues Viens,

You can use the following script to obtain the column in which the cell resides( in the context of OnEdit).
var grid = $(this).data("tGrid");
var column = grid.columns[grid.cellIndex(e.cell)];


Greetings,
Nikolay Rusev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
0
hugues viens
Top achievements
Rank 1
answered on 15 Dec 2011, 12:06 AM
thanks you for you fast reply, it works like a charm !
Tags
Grid
Asked by
hugues viens
Top achievements
Rank 1
Answers by
Nikolay Rusev
Telerik team
hugues viens
Top achievements
Rank 1
Share this question
or