SlickGrid 使用什么方法获取单元格内容?例如:
...
grid = new Slick.Grid($("#myGrid"), data, columns, options);
grid.onAddNewRow = function(item,colDef) {
grid.removeRow(data.length);
data.push(item);
grid.updateRowCount();
grid.render();
}
grid.onCurrentCellChanged = function(args){
// get cell content!
};
...
提前致谢!
最佳答案
网格直接修改您的数据源,因此更改将应用于“数据”。
“onCurrentCellChanged”事件在用户更改事件/选定单元格时触发,并获取 {row:currentRow, cell:currentCell} 作为参数。要获取单元格数据,您可以使用 data[args.row][grid.getColumns()[args.cell].field]
,假设您正在使用 column.field 访问数据而不是以其他方式获取数据的自定义格式化程序。
关于javascript - 从 SlickGrid 中的单元格获取数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4210120/