i have designed a form in extjs and exported proj to my rails appn.. soo 2 files that i am playing with is MyPanel.ui.js & MyPanel.js i want to populate combobox with json store.. when i w开发者_C百科rote below code :
{           xtype: 'combo',
            name:'username',
            id:'usercombo',
            ref:'usercombo',
            store:'RoleStore', autoShow:true,
            displayField:'username',
            valueField:'username',
            mode: 'local'
}
But when i write similar code in MyPanel.js, it does not work:
var combo1 = new Ext.form.ComboBox({
            store:'RoleStore', autoShow:true,
            displayField:'username',
            valueField:'username',
             mode: 'local',
              triggerAction: 'all',
              renderTo: 'usercombo'});`
I have followed link : http://bytes.com/topic/javascript/answers/887318-how-populate-combobox-data-extjs-2-3-a
Two possible issues I can see (you don't elaborate as to how it doesn't work):
- refin the original code has been replaced with- renderTo.- refis used to set the current- Componentinto the named property on a parent container.- renderTois used to give the id of the DOM element, Ext element, etc, that the component is to be rendered to. If there's no element with an id of- usercombothe second version will render into nothing.
- nameis missing from the second definition.
Add triggerAction:  'all', to the combobox configuration
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论