Hello,
I can get a Json string by my search panel who make a query and send me the good Json string formated.
I would like to display this result in a list.
I have two problems:
First one, how i can give this result to my store ?
I did that but it's don't work:
Code:
else {
Ext.Ajax.request ({
url: WPApp.config.host + WPApp.config.PhpPath + 'searchModule.php?search=' + query,
success: function (e) {
var obj = Ext.util.JSON.decode(e.responseText);
Ext.getStore(WPApp.stores.ResultPanelListStore).setObj(obj);
WPApp.views.ResultPanelList.update(obj);
WPApp.views.ResultPanelList.show();
}
});
And the list:
Code:
Ext.regModel('WPApp.stores.ResultPanelListModel', {
fields: [
{name: 'id', type: 'int'},
{name: 'name', type: 'string'},
{name: 'idCategory', type: 'string'},
]
});
WPApp.stores.ResultPanelListStore = new Ext.data.JsonStore({
model : 'WPApp.stores.ResultPanelListModel',
setObj: function (id) {
this.itemId = id;
WPApp.stores.DirectoryItemListListStore.load({data:this.itemId});
}
});
WPApp.views.ResultPanelList = new Ext.List ({
fullscreen: true,
itemTpl : '{name}',
store: WPApp.stores.ResultPanelListStore
});
I have only one results, and i sould have 2 results in my list. If i give an alert in the store, i get 2 results that's good but only one is displayed.
After, another problem, the list is displayed only 1 times on 3 of 4 request.
I don't know why ...
Can you help me?
Thanks