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

dirty flag is appearing when it should not

3 Answers 92 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Bat-Erdene
Top achievements
Rank 1
Bat-Erdene asked on 11 Aug 2015, 12:20 PM

Hello,

I am having a little problem. I am using the kendo grid widget and i use local array as my datasource. I am using batch editing. Whenever UnitPrice is modified, local array is updated and datasource read function is called to refresh the grid. The problem is the last row seems to have the dirty flag. I dont see any problem with what i am doing. Could you tell me why the last row has dirty flag?

I have created an example snippet in the following location.  I've also attached the file. http://dojo.telerik.com/@bat-erdene/EBego/2

3 Answers, 1 is accepted

Sort by
0
Boyan Dimitrov
Telerik team
answered on 13 Aug 2015, 09:41 AM

Hello Bat-Erdene,

Changing the value of the UnitPrice field of the model will update the model out of the box. The Grid will be refreshed with the new value anyway. Please refer to the http://dojo.telerik.com/apAbU example. In order to update CRUD operations with local data please refer to the CRUD Operations with Local Transport article. 

If you insist to update the array item in the save event calling the read method of the data source should be executed in setTimeOut. However I would not recommend  to use this approach for updating the local data. 

Regards,
Boyan Dimitrov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Bat-Erdene
Top achievements
Rank 1
answered on 13 Aug 2015, 10:04 AM

Hi Boyan,

Thanks for the reply. Let me explain what i am actually trying to do. I have a two grid. When the top grid column is modified i need to use the same value and update a column in the second grid. There could be multiple rows on the second gird so all will be updated. I am also updating group of rows on the top grid with the same value too. So I use the change event to update my local arrays and the push the values back to the grids.What approach would you suggest for this particular scenario.

Due to slow running process, I use multiple ajax call to populate my local array to give user progress status. Well actually the whole thing is liked to the scheduler widget. I am populating scheduler widget on each day with ajax call and same data then also pushed to the top grid. As each item is selected on the top grid, the bottom grid data is  populated with ajax call and pushed to the bottom grid. All these things are done through custom ajax call. I do know how to use crud operations with the local transport because i am using it. It seems to be easy way to push the local data to the grid.

 

 

 

 

 

 

 

 

 

0
Boyan Dimitrov
Telerik team
answered on 17 Aug 2015, 08:09 AM

Hello Bat-Erdene,

 

Please refer to http://dojo.telerik.com/oJOli example. The example demonstrate how to update the model in the second grid based on a change in the top grid. The update is implemented by using the set method of the model object. Since it is only for demo purposes it always updates the second item in the bottom grid. 

 

 

 

 

 

Regards,
Boyan Dimitrov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
Bat-Erdene
Top achievements
Rank 1
Answers by
Boyan Dimitrov
Telerik team
Bat-Erdene
Top achievements
Rank 1
Share this question
or