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

Refreshing Grid not updating model, but value updating in view

0 Answers 36 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Prabhu
Top achievements
Rank 1
Prabhu asked on 10 Jan 2018, 10:39 AM

This is my code:

dataitem["ApproverRole1"]  = '1'

dataitem["ApproverRole1Id"] ='1'

 

angular.forEach(grid.dataSource.data(), function (dataitem) {                              

         dataitem["ApproverRole1"] = '2';
         dataitem["ApproverRole1Id"] = '2';    

 });

before refresh updated data is available.

console: 

         dataitem["ApproverRole1"] = '2';
         dataitem["ApproverRole1Id"] = '2';    

But once below code executes then old value gets updated again in model

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

Console:

dataitem["ApproverRole1"]  = '1'
dataitem["ApproverRole1Id"] ='1'

Actual value should be 2 but 1 is still there.

Thanks for help.

 

 

No answers yet. Maybe you can help?

Tags
Grid
Asked by
Prabhu
Top achievements
Rank 1
Share this question
or