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

Grid / Editing custom editor

4 Answers 180 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Wit
Top achievements
Rank 1
Wit asked on 11 Sep 2014, 01:51 PM
angularjs 1.2.23
kendo ui v2014.2.909

I have a grid with foreign key, and I would like to display category name as drop down and allow user to change it. 

Flowing you example:
http://demos.telerik.com/kendo-ui/grid/editing-custom

I have manage to display data in the grid with use of template column for foreign key, then I am using editor for showing a drop down. Drop down works ok, user can select new value. For example initial category value is 'Produce', user can change it to 'Seafood' but when we switch to another cell display value goes back to 'Produce' when cell gets focus, display is changing back to 'Seafood'. Field has a red triangle showing that it was modified.  

I recreated it in dojo: 
http://dojo.telerik.com/oHIg

4 Answers, 1 is accepted

Sort by
0
Accepted
Nikolay Rusev
Telerik team
answered on 15 Sep 2014, 07:27 AM
Hello Wit,

This is because you are binding the column to field `CategoryID`, while you are displaying `Category.CategoryName` field instead. Thus when you change the value in the dropdown it is updating `CateogoryID` and the template is still referring to the other field.

The correct setup should be /as in the custom editor example/:
{
 field: "Category",
 title: "Category",
 width: "180px",
 editor: categoryDropDownEditor,
 template: "#=Category.CategoryName#"
}


Here is the updated example: http://dojo.telerik.com/@rusev/OvEv.

Regards,
Nikolay Rusev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Wit
Top achievements
Rank 1
answered on 15 Sep 2014, 10:33 AM
Thank you, that was exactly what I was looking for.
0
StevenDale
Top achievements
Rank 2
answered on 12 Jan 2015, 08:27 PM
This dojo example you posted does not work. http://dojo.telerik.com/@rusev/OvEv
0
Nikolay Rusev
Telerik team
answered on 14 Jan 2015, 09:10 AM

Hello Billy,

 

Seems to be working now - http://screencast.com/t/JqqQwKrjL.

 

Regards,
Nikolay Rusev
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
Wit
Top achievements
Rank 1
Answers by
Nikolay Rusev
Telerik team
Wit
Top achievements
Rank 1
StevenDale
Top achievements
Rank 2
Share this question
or