我是 Extjs 的新手,急需帮助!!我已经做了一些研究,并试图寻找解决方案 2 天,但没有找到解决我的问题的方法!我的问题如下:
我正在尝试创建包含 3 列组合框的网格。第一列将有一个组合框,可以禁用/启用该行中的其他组合框!当我更改第一列中的组合框时,第二列和第三列中的组合框全部更改!我不希望发生这种情况,我只想改变行!
我希望这是有道理的??如何在网格中的特定位置定位组合框并更改其配置?
多谢你们!!!!!
这是我到目前为止所拥有的......这是我所有组合框的格式:......
/***************/
/* COMBO BOXES */
/***************/
//PROTOCOL COMBO BOX!
var protocol_cbox = new Ext.form.ComboBox({
typeAhead: true,
triggerAction: 'all',
// lazyRender: true ,
mode: 'local',
store: new Ext.data.ArrayStore({
id: 0,
fields: [
'myId',
'displayText'
],
data: [[1, 'Ethernet'], [2, 'Serial']]
}),
valueField: 'myId',
displayField: 'displayText',
});
这是我选择的型号......
/****************/
/* COLUMN MODEL */
/****************/
var rownum = new Ext.grid.RowNumberer();
var grid_column_model = new Ext.grid.ColumnModel([
new Ext.grid.RowNumberer(),
{header: "Program", dataIndex: "program", align: 'center', width: myGridColumnWidth/2, editor: program_tbox},
{header: "Protocol", dataIndex: "Protocol", align: 'center', width: myGridColumnWidth/2, editor: protocol_cbox, renderer: Ext.util.Format.comboRenderer(protocol_cbox)},
{header: "Hostname", dataIndex: "hostName", align: 'center', width: myGridColumnWidth/2, editor: hostname_tbox},
{header: "Port", dataIndex: "Port_E", align: 'center', width: 100, editor: port_tbox},
{header: "Device", dataIndex: "Port_S", align: 'center', width: 100, editor: device_tbox},
{header: "Baud", dataIndex: "Baud", align: 'center', width: 100, editor: baud_cbox, renderer: Ext.util.Format.comboRenderer(baud_cbox)},
{header: "Data Bits", dataIndex: "DataBits", align: 'center', width: myGridColumnWidth/2, editor: dataBits_cbox, renderer: Ext.util.Format.comboRenderer(dataBits_cbox)},
{header: "Parity", dataIndex: "Parity", align: 'center', width: myGridColumnWidth/2, editor: parity_cbox, renderer: Ext.util.Format.comboRenderer(parity_cbox)},
{header: "Stop Bits", dataIndex: "StopBits", align: 'center', width: myGridColumnWidth/2, editor: stopBits_cbox, renderer: Ext.util.Format.comboRenderer(stopBits_cbox)},
{header: "Flow Control", dataIndex: "FlowControl", align: 'center', width: 125 , editor: flowControl_cbox, renderer: Ext.util.Format.comboRenderer(flowControl_cbox)}
]);
最后这是我的处理函数!...........
//DISABLE OR ENABLE CBOX HANDLER
function hide_unhide(){
for(i=0; i<= store.getCount() - 1; i++){
if(store.getAt(i).data.Protocol== 1){
baud_cbox.setDisabled(false);
} else {
baud_cbox.setDisabled(true);
}
}
}