Populating a drop down in EXT js grid depending on value of selection of another drop down
header: "Root",
sortable: true,
renderer: cat_id1,
dataIndex: 'parent_id',
width: 90,
editor: new Ext.form.ComboBox({
typeAhead: true,
triggerAction: 'all',
transform:'cat_id1',
lazyRender:true,
开发者_如何转开发 listClass: 'x-combo-list-small'
})
can I make the value of "renderer:" and "transform:" dynamic or dependent on the selection of another dropdown selection?
The easiest way to do this, is to actually render a whole new combo box whenever the answer in the first combo box is changed, using the store containing the answers you want. So add a select listener to your first box, which grabs the second box, hides it, destroys it, and then adds a new box using the store of answers you want the new second box to have available.
Make sure to call destroy() on the combo box you're getting rid of, so you don't have a bunch of hidden elements clogging up the document.
精彩评论