View Full Version : Store.loadRecords should fire an additional event apart from add/datachanged

5 Dec 2011, 10:43 AM
I believe in Ext, store.loadRecords fires the 'load' event. But in Touch 2, this method calls 'add' which further calls 'insert' which fires the 'add' event, and then the 'datachanged' event.
'loadRecords' itself then fires 'datachanged' again.

If you are doing some time consuming operation in 'datachanged', it gets executed twice. So one solution is to remove firing 'datachanged' from loadRecords method.

But 'datachanged' is fired on add/remove/updation of records. There are cases where loading of records into store needs to be handled separately especially when append is false, e.g.:
store.loadData(jsonArray, false);

This is similar to loading of record, albeit locally. So 'load' or another new event needs to be fored from loadRecords method.

Jamie Avins
5 Dec 2011, 11:02 AM
I wouldn't recommend using 'datachanged' for anything. It's seriously flawed and we are adding many new events into the data package. This is not a 'bug' per say so I'm going to move this to the discussion area.

5 Dec 2011, 1:51 PM
I was also not sure whether to call this a bug or a design decision. I will watch out for the upcoming release with the "many new events".
Any timeline for preview 3/alpha 1?