Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to dynamically assign value to the store in ExtJS Itemselector?
    primarykey
    data
    text
    <p>I have to fill values in the right multiselect box in an itemselector. <strong>First i need to keep it blank and then on selection of an item in the combo box above it, i have to fill values accordingly</strong>. I have tried this and its crashing at the moment and nothing seems wrong. Here is the code snippet:</p> <pre><code>var userList = GetUserList(); var aoiList = GetAOIList(); var userAOIs = ""; var selectedUser=""; var userStore = new Ext.data.ArrayStore({ fields: ['user'], data: userList }); var aoiStore = new Ext.data.ArrayStore({ fields: ['aoiList'], data: aoiList }); var userAOIStore = new Ext.data.ArrayStore({ fields: ['userAOIs'], data: userAOIs }); var aafp = new Ext.FormPanel({ width : 350, frame : true, autoHeight : true, bodyStyle : 'padding: 2px 5px 0 2px;', labelWidth : 100, defaults : { anchor : '95%', allowBlank : false, msgTarget : 'under' }, items : [ { xtype : 'combo', fieldLabel : 'Choose User', emptyText: "Select User...", id : 'userId', name : 'user', multiSelect: false, store: userStore, displayField: 'user', mode: 'local', editable: false, typeAhead: true, triggerAction: 'all', listeners:{select:{fn:function(combo, value) { selectedUser = value.get('user'); userAOIs = myAOIs(selectedUser); userAOIStore = new Ext.data.ArrayStore({ fields: ['userAOIs'], data: userAOIs}); aafp.getForm().findField("itemselector").reset(); }} }, value : selectedUser },{ xtype: 'itemselector', name: 'itemselector', fieldLabel: 'AOISelector', imagePath: 'ext-3.4.0/examples/ux/images/', drawUpIcon:false, drawDownIcon:false, drawTopIcon:false, drawBotIcon:false, multiselects: [{ width: 250, height: 200, store: aoiStore, displayField: 'aoiList' },{ width: 250, height: 200, store: userAOIStore, displayField: 'userAOIs', valueField: 'userAOIs' }] }] </code></pre> <p>Initially i doubted the "aafp.getForm().findField("itemselector").reset()" call and thought that there might be some other function to dynamically reload the elements in the form, instead of reset which might be used to reset/erase the data in the fields but reset is reloading the contents. Please provide your inputs how this could be achieved?</p> <p>Thanks</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload