我想知道如何更新或重新加载ExtJs ComboBox的列表值的方法.例如,我有一些复选框.这些复选框确定ComboBox应具有的值.因此,在选择其中一些之后,我点击了drowndown列表(组合框)来查看值.
简而言之,我如何更改ComboBox已有的值(存储).
希望可以有人帮帮我
谢谢
Rob*_*rto 14
我一直在使用这个未记录的ExtJs API函数来在运行时更改存储:
mycombobox.bindStore(newStore);
Run Code Online (Sandbox Code Playgroud)
正如支持团队在http://www.sencha.com/forum/showthread.php?40749-Change-Combobox-store-data-update中所述.
编辑:如果我想在填充商店时放入新数据,我会这样做
storeMyStore = new Ext.data.Store({
...
listeners: {
load: function(this, records, options) {
cbMyCombo.bindStore( storeMyStore );
}
}
});
Run Code Online (Sandbox Code Playgroud)
它有点像这样
{
xtype: 'checkbox',
//configs
listeners : {
checked : function (checkbox, checkedBool) {
var yourCombo = Ext.getCmp(yourComboID);
//I'm not sure what params you will need to reload the comboBox from your
// service but hopfully this will give the jist of things. . .
yourCombo.store.reload(
{
params:
{yourParam : checkedBool},
{yourRowID : rowID}
});
}
}
Run Code Online (Sandbox Code Playgroud)