lu2vik
18 Apr 2012, 1:40 PM
Hi,
I would like to know how I can add only new records with the Ext.plugin.PullRefresh ?
I followed the sample but the old records are also added ...
When I look at the source code of onLatestFetched method :
...
newRecord = newRecords[i];
alert(newRecord.getId());
oldRecord = oldRecords.getByKey(newRecord.getId());
if (oldRecord) {
oldRecord.set(newRecord.getData());
} else {
toInsert.push(newRecord);
}
...
The getter newRecord.getId() returns a new Id each time. Same on the old records.
Any idea ? Maybe, must I send (in json) only the new records ?
Thanks a lot !
I would like to know how I can add only new records with the Ext.plugin.PullRefresh ?
I followed the sample but the old records are also added ...
When I look at the source code of onLatestFetched method :
...
newRecord = newRecords[i];
alert(newRecord.getId());
oldRecord = oldRecords.getByKey(newRecord.getId());
if (oldRecord) {
oldRecord.set(newRecord.getData());
} else {
toInsert.push(newRecord);
}
...
The getter newRecord.getId() returns a new Id each time. Same on the old records.
Any idea ? Maybe, must I send (in json) only the new records ?
Thanks a lot !