You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let's just begin by saying that with plain Kendo controls it's not possible to have two-way databinding at all. We build a value-binding feature that allows you to two-way databind the value property and it uses the value() function of the Kendo control to tell it to update the value. So this is not "real" two-way databinding, but from a user perspective it would seem as shown in this: example.
The datasource is also a bit unique. You can bind the datasource property of a control to a plain javascript object like we do here. Kendo's combobox is getting this javascript object and wraps it into a datasource class instance. The original reference to the datasource is lost, so if you update a property in there it will not be noticed by the control. Wrapping the plain javascript object into a new kendo.data.DataSource() is one of the solutions you may consider:
That way Kendo's control wont wrap the datasource into a a kendo.data.DataSource instance again, but it will just use the original instance (call by reference is used instead of call by value with plain javascript objects). So if you use kendo.data.DataSource instead of the plain javascript object, so you should be able to bind a single datasource to multiple controls.
In all other cases you'd need to either use functions like enable(), setOptions() or even our recreate() function to tell the control to pick up the changed value
Note: Some Kendo controls have functions like setOptions() or setDataSource() that allow you to change an option of the Kendo control without having to destroy and recreate it. As one of the alternative solutions, we would like to see all Kendo controls have such functions
The text was updated successfully, but these errors were encountered:
Two way binding
Let's just begin by saying that with plain Kendo controls it's not possible to have two-way databinding at all. We build a value-binding feature that allows you to two-way databind the value property and it uses the value() function of the Kendo control to tell it to update the value. So this is not "real" two-way databinding, but from a user perspective it would seem as shown in this: example.
The datasource is also a bit unique. You can bind the datasource property of a control to a plain javascript object like we do here. Kendo's combobox is getting this javascript object and wraps it into a datasource class instance. The original reference to the datasource is lost, so if you update a property in there it will not be noticed by the control. Wrapping the plain javascript object into a new
kendo.data.DataSource()
is one of the solutions you may consider:That way Kendo's control wont wrap the datasource into a a kendo.data.DataSource instance again, but it will just use the original instance (call by reference is used instead of call by value with plain javascript objects). So if you use
kendo.data.DataSource
instead of the plain javascript object, so you should be able to bind a single datasource to multiple controls.In all other cases you'd need to either use functions like
enable()
,setOptions()
or even ourrecreate()
function to tell the control to pick up the changed valueNote: Some Kendo controls have functions like
setOptions()
orsetDataSource()
that allow you to change an option of the Kendo control without having to destroy and recreate it. As one of the alternative solutions, we would like to see all Kendo controls have such functionsThe text was updated successfully, but these errors were encountered: