Grid data set by JQuery lost during inline edit

2 posts, 0 answers
  1. Hunter
    Hunter avatar
    24 posts
    Member since:
    Jan 2014

    Posted 22 Jan 2015 Link to this post

    I have a pretty simple grid, which includes 6 select boxes. I've attached a JQuery listener to the first select box so that when a value is selected, I make an ajax call to return the values for the remaining 5 select boxes. I use JQuery to set their values, visually everything looks peachy, but as soon I click Update on the row, all of my JQuery set values disappear and the record updates without them. 

    If I manually select all the select boxes, they update fine. I've inspected the HTML for both situations, dynamically and manually set data, and I don't see any difference. 

    What am I missing?

    Thanks!

  2. Dimo
    Admin
    Dimo avatar
    8331 posts

    Posted 24 Jan 2015 Link to this post

    Hello Curtis,

    When you update the form fields inside the Grid programmatically, the widget is not aware of this. As a result, the underliying data items are not updated either, and when the Update button is clicked, there is nothing to update. The editing mechanism does not take the form field values when the Update button is clicked. Instead, it relies on MVVM and two-way binding, which updates the data item when a change event of a form field is fired. That's why you can trigger this event manually for each form controls that has its value changed via script.

    $("selector").val("value").trigger("change");


    Regards,
    Dimo
    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
Back to Top