如何更新sqlite代理存储中的记录

时间:2013-12-18 10:09:50

标签: extjs sencha-touch-2

我在我的sencha应用程序中使用SQLite代理来使应用程序脱机。谁能告诉我如何更新商店中的记录。我尝试了store.set('filed',value),但它没有用。

这是我正在使用的代码..

Ext.getStore('Team').each(function(record) {
        if(record.get('race_id') == raceId && record.get('round') == round) {
            record.set('start_position', startPosition);
        }
    });
Ext.getStore('Team').sync();

我引用this来实现SqlLite-proxy。

1 个答案:

答案 0 :(得分:0)

首先set方法不是用于存储这个方法是记录的,你必须在更新记录之后同步存储,以便在localstorage中进行最终更改,如`

record.set('field',value); 
store.sync();