PDA

View Full Version : ItemSelector - hidden true property gives error



shkamboj
24 Jan 2012, 5:06 PM
Hello ,
I am using ItemSelector for one of the views in my application . The requirement is such that when the view is rendered the ItemSelector should be hidden and on click of a form field it will be visible . Problem is if i set hidden as true to ItemSelector then the view doesn't render and shows error as -



Uncaught TypeError: Cannot call method 'remove' of undefined
Ext.define.beforeLayoutext-all-debug.js:21466
Base.callParentext-all-debug.js:2874
Ext.define.beforeLayoutext-all-debug.js:69039
Ext.define.layoutext-all-debug.js:20530
Ext.define.doComponentLayoutext-all-debug.js:17344
Ext.define.refreshext-all-debug.js:70526
fireext-all-debug.js:10628
Ext.define.fireEventext-all-debug.js:13810
Ext.define.removeAllext-all-debug.js:45656
Ext.define.bindStoreItemSelector.js:66
Ext.define.onRenderItemSelector.js:160
Ext.define.render

I verified that the code is trying to call remove method on layoutcollection and layoutcollection is 'undefined' in this case . If i remove the 'hidden:true' from the configuration, itemSelctor works fine .

Can anyone please help in this ?

Thanks

josephkirubakaran
28 Jan 2012, 1:01 AM
Can you provide your code piece?

shailykamboj
30 Jan 2012, 3:34 PM
Hello Jose ,
i am often getting this error related to 'remove' while using itemSelector . Like when i am trying to do bindStore , then also i am getting the same error --



Uncaught TypeError: Cannot call method 'remove' of undefined

Ext.define.beforeLayoutext-all-debug.js:21466 (http://10.38.14.199:7201/Editor/ext/ext-all-debug.js)
Base.callParentext-all-debug.js:2874 (http://10.38.14.199:7201/Editor/ext/ext-all-debug.js)
Ext.define.beforeLayoutext-all-debug.js:69039 (http://10.38.14.199:7201/Editor/ext/ext-all-debug.js)
Ext.define.layoutext-all-debug.js:20530 (http://10.38.14.199:7201/Editor/ext/ext-all-debug.js)
Ext.define.doComponentLayoutext-all-debug.js:17344 (http://10.38.14.199:7201/Editor/ext/ext-all-debug.js)
Ext.define.refreshext-all-debug.js:70526 (http://10.38.14.199:7201/Editor/ext/ext-all-debug.js)
fireext-all-debug.js:10628 (http://10.38.14.199:7201/Editor/ext/ext-all-debug.js)
Ext.define.fireEventext-all-debug.js:13810 (http://10.38.14.199:7201/Editor/ext/ext-all-debug.js)
Ext.define.removeAllext-all-debug.js:45656 (http://10.38.14.199:7201/Editor/ext/ext-all-debug.js)
Ext.define.bindStoreItemSelector.js:65 (http://10.38.14.199:7201/Editor/app/ux/form/ItemSelector.js?_dc=1327966145163)
(anonymous function)Permissions.js:54 (http://10.38.14.199:7201/Editor/app/controller/explore/package/Permissions.js?_dc=1327966144467)
Ext.apply.callbackext-all-debug.js:5263 (http://10.38.14.199:7201/Editor/ext/ext-all-debug.js)
Ext.define.onProxyLoadext-all-debug.js:44974 (http://10.38.14.199:7201/Editor/ext/ext-all-debug.js)
Ext.define.processResponseext-all-debug.js:25744 (http://10.38.14.199:7201/Editor/ext/ext-all-debug.js)
(anonymous function)ext-all-debug.js:25935 (http://10.38.14.199:7201/Editor/ext/ext-all-debug.js)
Ext.apply.callbackext-all-debug.js:5263 (http://10.38.14.199:7201/Editor/ext/ext-all-debug.js)
Ext.define.onCompleteext-all-debug.js:18133 (http://10.38.14.199:7201/Editor/ext/ext-all-debug.js)
Ext.define.onStateChangeext-all-debug.js:18084 (http://10.38.14.199:7201/Editor/ext/ext-all-debug.js)
(anonymous function)





code is -
loadUsers : function(itemSelector , opts){

var store = this.usersStore; //usersStore is one of the stores defined in this controller
store.load(
function(){
var ct = store.getTotalCount();
console.log('count ...'+ct);
itemSelector.bindStore(store);
}
);

}