r_honey
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.
'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.