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

Cannot trigger update action without manually input?

2 Answers 682 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Paddy
Top achievements
Rank 1
Paddy asked on 08 Dec 2015, 02:41 AM

Hi, I'm using customized popup editor to edit a record, its data source is a remote one accessed via WEBAPI.The UI is as the attachment.

The textbox (name) and Default checkbox is bound, but the checkboxes list is not bound and it is coming from another remote datasource, and it is initialized with the first data source a comma seperated string such as 1,3,5,7.


 When I input something in the textbox or click Default checkbox, and when I click Update button then update event is triggered. But if I didn't change the text or Default option, only select/unselect items in the checkboxes list,  the update is NOT triggered. I think this might because the checkboxes list is not bound thus making change of it having no effect on the grid data source and model, so I change the field like e.model.filename = newValue in the checkboxes change event, but Update event is still not triggered. 

 I look into API documents, it says if model's set method is used, the model change event will be triggered. But my following code does not work at all:
    var model = $('#grid').data().kendoGrid.editable.options.model;
    model.set("keyIds", checkedItems.join());  //here checkedItems is the array of keys of checkboxes items.

I want know, how can I trigger update with only checkboxes changes?

Or, can you provide a solution for binding a checkboxes list to a collection? Treeview behaves like what I want, but it's UI is not.

 P.S. Every time I posted a question here, I've got to wait 2 or more days for an answer. As you know, constantly one answer is not enough to solve a problem, but after I response to your answer, I've to wait days again for another answer, even my response is only 15 to 30 minutes after your post. It is not rare to solve a problem with over 5 ping-pong, then it will need 10-15 days or more to get the problem done. How can I make it more efficient?

 

Looking forward your reply. Thanks!

2 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 10 Dec 2015, 10:11 AM
Hello,

If you change the model field to array then the built-in checked binding should work out of the box for the cehckbox list as demonstrated in this demo. If the model field must be a comma separated string then you will need to implement a custom binding in order to bind the value(example).

As for manually updating the value - if the value is assigned without the set method then you should also set the dirty field:
e.model.filename = newValue;
e.model.dirty = true;
I am not sure if I understand when is the other code used but the update operation should be triggered as long as the new value is different than the current one.

Regarding the response time - if you need quicker reply then I would suggest to submit a support ticket which have 24 hour response time.

Regards,
Daniel
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Paddy
Top achievements
Rank 1
answered on 15 Dec 2015, 03:14 AM
Thank you Daniel, it works!
Tags
Grid
Asked by
Paddy
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Paddy
Top achievements
Rank 1
Share this question
or