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

[Solved] DataItem 'observable' does not update grid row on .set(...)

2 Answers 334 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Andrew
Top achievements
Rank 1
Andrew asked on 26 Feb 2015, 06:22 PM
I have a custom-command button on my grid which takes some action, and then ought to update a column in the grid, which is a boolean, per the schema. My DataSource is built from a local array.

It seems the .set() method that I use to update the dataItem will cause updates on string columns very nicely, but boolean columns won't bind reliably (the column is not updated with a call to

  myDataItem.set('col', true);


...for example. So I have to do something like 

    $('#grid').data('kendoGrid').refresh();

...to get the grid to update reliably.  

Is this expected behavior?  I've seen posts that refer to .sync(), the autoSync property, and possibly setting a 'save()' function on the grid definition.  But I have't had consistent success with any of these.

Thanks.



2 Answers, 1 is accepted

Sort by
0
Andrew
Top achievements
Rank 1
answered on 27 Feb 2015, 02:47 AM
Figured it out as I was typing up an example - oversight whereby I'd set the column's "editable" property on the schema to false... sorry.
0
Andrew
Top achievements
Rank 1
answered on 27 Feb 2015, 02:48 AM
Fixed - oversight whereby I'd set the column to not editable in the schema. Sorry.
Tags
Grid
Asked by
Andrew
Top achievements
Rank 1
Answers by
Andrew
Top achievements
Rank 1
Share this question
or