-
1 Aug 2011 1:17 AM #1
[closed] [Ext JS 4.0.2a]itemselector not reloading the store
[closed] [Ext JS 4.0.2a]itemselector not reloading the store
i need to dynamically generate the items in the itemselector with the reloading of store ,in ext 3 it is working perfectly but for some reason in extjs 4 the itemselector store does not accept new data into it with reloading of store .
please suggest how can i reload the itemselecttor store after it has been rendered .
-
1 Aug 2011 4:27 AM #2
solved the problem after some going through its doc. , used the method bindStore() , to reload the store dynamically to the itemselector .
it would be done like this .
var itemsel = Ext.create('Ext.ux.form.ItemSelector',{
fieldLabel: 'FieldSelector',
imagePath: 'ext4/ux/images/',
store: ds,
..//ur config options
});
then , to reload store use ...
itemsel.bindStore(newstore);

-
22 Feb 2012 2:00 PM #3
reloading/refreshing store doesn't work for me too , i used this.
myitemselector.fromField.store.load();
-
5 Nov 2012 1:24 PM #4
bindStore()
bindStore()
You saved my life!!
itemsel.bindStore(newstore);
-
10 Jan 2013 10:35 AM #5
I am also trying to reload itemselector on another combobox select but its not working for me.
bindStore() is acting weird. Its always loading data from previous filter. For example
If first value that I select in cbo1 is USA
itemselector: shows nothing
When I change cbo1 value to UK
now itemselector shows the filtered cities from USA (hence from previous filter)
when i change cbo1 value to Germany
now itemselector shows the filtered cities from UK (from previous filter again)
and so on. So item selector is always a step behind showing values from previous filter operation. Here is my code
My store's constructor isPHP Code:items: [
{
xtype: 'combobox',
anchor: '100%',
id: 'adminpfformreport',
name: 'adminpfformreport',
maxWidth: 400,
fieldLabel: '<b>Reports</b>',
allowBlank: false,
queryMode: 'local',
blankText: 'You must select Report to proceed',
displayField: 'layout',
store: 'Report',
valueField: 'layout',
listeners: {
select: function(cbo,mixedValue){
adminpfstore = Ext.getCmp('adminpfformaccounts').store;
adminpfstore.load({
params: {'layout': cbo.getValue()}
});
Ext.getCmp('adminpfformaccounts').bindStore(adminpfstore);
console.log(adminpfstore);
}
}
},
{
xtype: 'itemselector',
name: 'adminpfformaccounts',
id: 'adminpfformaccounts',
anchor: '100%',
fieldLabel: '<b>Portfolios</b>',
imagePath: '../extjs/ux/images/',
triggerAction: 'all',
queryMode: 'remote',
store: 'AdminPortfolio' ,
displayField: 'portfolio',
valueField: 'portfolio',
value: [],
allowBlank: false,
msgTarget: 'side'
}
]
I am checking ajax calls and store is loading/filtering correct dataPHP Code:constructor: function(cfg) {
var me = this;
cfg = cfg || {};
me.callParent([Ext.apply({
autoLoad: false,
storeId: 'adminportfolio',
model: 'RiskDashboard.model.Portfolio',
proxy: {
type: 'ajax',
url: 'cfcs/riskdashboard.cfc?method=getAvailablePFList',
reader: {
type: 'json',
root: 'ROWS',
successProperty: 'SUCCESS',
totalProperty: 'TOTAL'
},
listeners: {
exception: {
fn: me.onAjaxproxyException,
scope: me
}
}
}
}, cfg)]);
},
What am I missing?
-
21 Apr 2013 5:33 AM #6
Solved this
Solved this
fix in function populateFromStore:
Code:Index: ItemSelector.js =================================================================== RCS file: /arch/cvs/it/lib/extjs/ux/ItemSelector.js,v retrieving revision 1.2 diff -c -r1.2 ItemSelector.js *** ItemSelector.js 21 Apr 2013 13:20:45 -0000 1.2 --- ItemSelector.js 21 Apr 2013 13:32:09 -0000 *************** *** 352,358 **** // Flag set when the fromStore has been loaded this.fromStorePopulated = true; ! fromStore.add(store.getRange()); // setValue waits for the from Store to be loaded fromStore.fireEvent('load', fromStore); --- 352,358 ---- // Flag set when the fromStore has been loaded this.fromStorePopulated = true; ! fromStore.loadData(store.getRange()); // setValue waits for the from Store to be loaded fromStore.fireEvent('load', fromStore);Yaron Yogev
IT Software Developer
-
30 Apr 2013 1:15 AM #7
any idea how to bind values? I mean the selected ones ?
Thank you for reporting this bug. We will make it our priority to review this report.


Reply With Quote