Grid / Editing custom editor

5 posts, 1 answers
  1. Wit
    Wit avatar
    43 posts
    Member since:
    Aug 2014

    Posted 11 Sep 2014 Link to this post

    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
  2. Answer
    Nikolay Rusev
    Admin
    Nikolay Rusev avatar
    2284 posts

    Posted 15 Sep 2014 Link to this post

    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!
     
  3. Kendo UI is VS 2017 Ready
  4. Wit
    Wit avatar
    43 posts
    Member since:
    Aug 2014

    Posted 15 Sep 2014 in reply to Nikolay Rusev Link to this post

    Thank you, that was exactly what I was looking for.
  5. StevenDale
    StevenDale avatar
    100 posts
    Member since:
    Apr 2007

    Posted 12 Jan 2015 in reply to Nikolay Rusev Link to this post

    This dojo example you posted does not work. http://dojo.telerik.com/@rusev/OvEv
  6. Nikolay Rusev
    Admin
    Nikolay Rusev avatar
    2284 posts

    Posted 14 Jan 2015 Link to this post

    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!
     
Back to Top
Kendo UI is VS 2017 Ready