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

Edit event for inCell mode - tell us which model field is being edited

3 Answers 151 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Curt Rabon
Top achievements
Rank 1
Veteran
Curt Rabon asked on 23 Jun 2015, 04:35 PM

I've used Kendo UI since almost the very first release, and the following problem has been there all this time.

From what I see by looking at your .js source code, when using batch/inCell edit mode you already know which model field is being edited when you call the "edit" event, yet you don't give that info to us in the event arguments.  Why not?  Many, Many times when developers handle the Edit() event in batch/inCell mode, the model field being edited is important to know.

You could very easily pass that to the event.  I don't understand why you've let it be this way for so long.  Please explain.

3 Answers, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 25 Jun 2015, 03:43 PM

Hello Curt,

This is done for consistency with other (in-line, popup) edit modes as there are no single field associated with the container in those situations.

However, in order to get the field name for the container for in-cell edit mode you may use the cellIndex method to get associated column and its field name. Similar to the following:

                     edit: function(e) {
            console.log(this.columns[this.cellIndex(e.container)].field);
          }

 

Regards,
Rosen
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Curt Rabon
Top achievements
Rank 1
Veteran
answered on 25 Jun 2015, 06:19 PM

That's a shame. See attached picture. You already have the field in your hand when you call the Edit event.  You could simply pass it as the last parameter, and make the documentation say that it's only available in "inCell" mode.

You already do something similar in the grid's "save" event.  There, the documentation states the following about the e.values property:

Available only when the editable.mode option is set to "incell".

0
Rosen
Telerik team
answered on 29 Jun 2015, 05:53 AM

Hello Curt,

If you feel such functionality should be included in the library, please feel free to share your suggestion in our feedback portal.

Regards,
Rosen
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
Curt Rabon
Top achievements
Rank 1
Veteran
Answers by
Rosen
Telerik team
Curt Rabon
Top achievements
Rank 1
Veteran
Share this question
or