4
值我有以下的店鋪:檢索存儲
Ext.define('Sencha.model.MenuPoint', {
extend: 'Ext.data.Model',
config: {
fields: [
{name: 'id', type: 'string'},
// this is id of the element, example child id, report id, and so fourth
//{name: 'elementId', type: 'int'},
{name: 'name', type: 'string'},
{name: 'icon_url', type: 'string'},
{name: 'xtype', type: 'string'}
]
}
});
我設法插入和檢索這樣的值:
var keyValue = new Object();
keyValue.key = "adultId";
keyValue.value = adultObj.adultId;
console.log("keyValue: "+keyValue);
var sessionStore = Ext.getStore('MySessionStore');
sessionStore.add(keyValue);
sessionStore.sync();
var index = sessionStore.find('key',keyValue.key);
console.log("index: "+index);
var keyValue2 = sessionStore.getAt(index);
console.log("keyValue2: "+keyValue2);
不過這樣麻煩先拿到指標,然後得到的價值,是不是有可能做這樣的事情:
var value = store.get(key);
?
感謝,認爲解決它 – 2012-07-30 08:58:22
你有什麼想法如何獲得索引值根據tapped.http://stackoverflow.com/questions/18206412/getting-index-value-0-from-dataview-any-list-itemtap-from-sencha-touch – 2013-08-14 07:28:30