I have a kendoui grid with a custom popup for editing.
In this popup I have an input which is bound to a value of the grid:
<input type="text" class="k-input k-textbox" id="test" data-bind="value:SearchFilter">
This works fine. Click edit in the grid, change the value in the textbox and the value propagates to the grid.
But now I want to change the value of the textbox in javascript.. So I now have this:
$('#test').val("testvalue");
This indeed changes the value of the textbox, but upon save the new value isn't propagated to the grid. I guess because no change event occurs on the textbox.
How do I make this work?
Bind data to Kendo Grid by using AJAX Read action method. Change the datasource on change event of any HTML controls. Normally, a developer can bind the data to Grid by using AJAX Read method. This read method is ActionResult method in MVC which will return JSON DataSourceResult & direclty bind the data to Grid.
Kendo UI for jQuery is a professional grade UI library with 110+ components for building modern and feature-rich applications. To try it out sign up for a free 30-day trial.
I tried the above answer but did not work for me. Although the value had indeed changed, the view did not reflect that fact. This worked for me:
var myvar = $("#myid").data("kendoNumericTextBox");
myvar.value("newValue");
myvar.trigger("change", { value: myvar.value() });
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With