我目前遇到了用新參數重新加載json商店的麻煩。這是我的店:用新參數重新加載json商店ExtJs Ext.data.JsonStore
newsletters = new Ext.data.JsonStore({
url: '/newsletters/',
root: 'results',
fields: [
'id',
'body'
'recipients'
],
baseParams: { command: 'json', to: dateTo, from: dateFrom },
autoLoad: true
});
dateTo和dateFrom是initally空字符串(「」),並在Firebug檢查/通訊時調用正確的參數。
現在沒有以下卡瑪森工作:
更改dateTo和dateFrom的值,然後調用newsletters.reload()調用仍然與參數的頁面,並從爲空字符串。
調用newsletters.reload({ to: 'test1', from: 'test2' });
仍然將參數視爲空字符串。
最後從手動我曾嘗試:
lastOptions = newsletters.lastOptions;
Ext.apply(lastOptions.params, {
to: 'test1',
from: 'test2'
});
newsletters.reload(lastOptions);
這再次不請求/更新的參數通訊。
任何意見讚賞!
我不知道,如果它的關鍵或不..但是你錯過了','body''在'fields' – Lipis 2011-01-11 21:17:44