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

DataSource - IsDirty Flag

1 Answer 359 Views
Data Source
This is a migrated thread and some comments may be shown as answers.
John Deary
Top achievements
Rank 1
John Deary asked on 08 May 2012, 03:20 PM
Is there a way that I am missing that will easily tell me if a DataSource linked to an editable grid has any pending changes?

I am able to set my own flag on the edit and saveChanges events of the Grid, but can't seem to find an event that corresponds the the "Cancel changes" button on the grid. Also, just because someone puts the grid into an edit mode, doesn't mean they actually go through with making a change.

I am thinking that there should be something on the Datasource object, as this holds all the data, but can't fin anything and there are only two events associated with that control, so tracking my own flag there doesn't seem feasible either.

Regards,

   John

1 Answer, 1 is accepted

Sort by
0
rlapao
Top achievements
Rank 1
answered on 08 May 2012, 06:53 PM
Hi John,

You have a property called 'dirty' in each data item.

For instance to select the dirty data:

var dirtyItems = $.grep(itemsDataSource.view(), function(e) { return e.dirty === true; });


Does anyone know if it's possible to mark some of the members of the dataSource model to don't cause the object to be dirty?
Tags
Data Source
Asked by
John Deary
Top achievements
Rank 1
Answers by
rlapao
Top achievements
Rank 1
Share this question
or