我有一个字段类型为'combogrid‘的数据网格,当我操作'endEdit’行时,它出错了!错误信息:‘未捕获TypeError:无法读取未定义的属性'dc’‘
我的代码如下:
$('#tt').datagrid({
url: "/hello",
method: 'get',
columns: [[
{field: 'id', title: 'ID', width: '20%'},
{field: 'name', title: '姓名', width: '20%'},
{
field: 'where',
title: '年份-地址',
width: '40%',
editor: {
type: 'combogrid',
options: {
data: addressData,
panelWidth: 160,
panelHeight: "auto",
idField: 'address',
textField: 'address',
editable: false,
columns: [[
{field: 'address', title: '编号', width: 60},
{field: 'year', title: '名称', width: 100}
]],
onSelect: function (index,row) {
console.log(row);
var row1 = $('#tt').datagrid('getSelected');
var index1 = $('#tt').datagrid('getRowIndex',row1);
$('#tt').datagrid('endEdit', index1);
$("#tt").datagrid("updateRow",{
index:index1, //行索引
row:{
year:row1.year //行中的某个字段
}
});
},
onLoadSuccess: function (a) {
}
}
}
},
{field: 'year', title: '年份', width: '20%', align: 'center'}
]]})
行出错:'$('#tt').datagrid('endEdit',index1);‘
发布于 2020-09-20 15:40:12
将'onSelect‘替换为'onClickRow',就可以了!
onClickRow: function (index, row) {}https://stackoverflow.com/questions/63976336
复制相似问题