javascript - cell.edit 不起作用(制表符 Node.js)
问题描述
我遇到了一个奇怪的问题:方法 "cell.edit()" 不起作用(错误"Uncaught TypeError: e.column.modules.edit is undefined"),但是同时所有其他方法都可以正常工作(例如 cell .getField();cell.getValue())。为什么会发生这种情况?
我的代码:
var table = new Tabulator("#grid1", {
data:dannyje_iz_json, //assign data to table
layout:"fitColumns", //fit columns to width of table (optional)
rowContextMenu: rowMenu, //add context menu to rows
columns:[ //Define Table Columns
{title:"ID", field:"id"},
{title:"Имя", field:"name", cellDblClick:function(e, cell){
cell.edit(true); //works fine if change this to alert(cell.getField()); alert(cell.getValue());
//now it leads to the error Uncaught TypeError: e.column.modules.edit is undefined
}},
{title:"Возраст", field:"age"},
],
});
提前致谢。
解决方案
您的列上没有定义编辑器,因此无法对其调用编辑。在双击事件中也没有必要调用编辑,它会按标准在单击时触发。
所以 yuo 会为列定义查看类似这样的内容:
{title:"Имя", field:"name", editor:"input"},
推荐阅读
- python - PowerBi 嵌入 RLS Wordpress
- python - 无法通过 PyASN1 模块执行 SNMP_SET
- react-native - 使用 Expo 将应用程序发布到 ios 时出现 EXNetwork 错误 403?
- powershell - Powershell 获取组、成员和成员的详细信息
- angular - Angular formGroup多个InputControl valueChanges事件通过使用属性名称数组
- angular - http.get 的 Angular 10 订阅不起作用
- javascript - Vuelidate - 比较当前验证对象中的日期
- database - 如何将html函数存储在数据库中
- mysql - 嵌套查询:选择不在另一个查询结果中的结果
- spring-boot - GCP 发布-订阅 @Transactional