- 注册时间
- 2013-7-8
- 最后登录
- 2019-1-9
- 阅读权限
- 10
- 积分
- 103
- 精华
- 0
- 帖子
- 24
|
factory 发表于 2013-8-13 22:28
首先你要明白一点,表格的编辑器只有在编辑的时候才会被创建对应单元格的所属编辑器,不然你表格有很多数据 ...
根据你的方法可以进行联动了 但是子combobox的值选了后不能放到grid中
function OnCellCommitEdit(e) {
var grid = e.sender;
var record = e.record;
var field = e.field, value = e.value;
if (field == "manufacturer") {
grid.updateRow(record, { deviceclass: "", deviceclass_name: "" });
}
}
var a3101150002 = ${applicationScope.dic['3101150002']};
var a3101150003 = ${applicationScope.dic['3101150003']};
var a3101150004 = ${applicationScope.dic['3101150004']};
function OnCellBeginEdit(e) {
var grid = e.sender;
var record = e.record;
var field = e.field, value = e.value;
var editor = e.editor;
if (field == "deviceclass") {
var id = record.manufacturer;
if(id=="3101150002"){
editor.setData(a3101150002);
}else if(id=="3101150003") {
editor.setData(a3101150003);
} else if(id=="3101150004") {
editor.setData(a3101150004);
} else {
editor.setData(null);
}
}
}
<div field="manufacturer" name="manufacturer" displayField="manufacturer_name" headerAlign="center" align="center" width="80px" renderer="onGenderRenderercs" >厂商
<input property="editor" class="mini-combobox" id="manufacturer" style="width:100%;" textField="value" valueField="code" shownullitem="true" data="${applicationScope.dic['MANUFACTURER']}"/>
</div>
<div field="deviceclass" name="deviceclass" displayField="deviceclass_name" type="comboboxcolumn" headerAlign="center" align="center" width="80px" >设备
<input property="editor" id="deviceclass" class="mini-combobox" style="width:100%;" textField="value" shownullitem="true" valueField="code" />
</div> |
|