grid.dataItem(selectedRow)
this is return the selected row which is a kendo.data.ObservableObject.
this object has all the columns for that grid's selected row. Is there a way to iterate thru all the columns and update. or do i have to do it like this:
dataitem.set("Id", 1);
dataitem.set("name", Eric);
dataitem.set("age", 12);
As far as I understand what you are trying is to copy one JavaScript object into a Grid item, correct?
Let's assume that you have the new value in
val
:And you want to copy it in the selected row.
There are several ways of doing it:
val
and copy the value.Option 2.
Option 3.
The first instruction performs a deep copy of
val
intoitem
. The second instruction makes the itemdirty
by just changing the UID.NOTE: You don't need to update every single field using
set
, is enough changing one and all will get updated.