我刚刚开始将 handsontable 与 JSON 数据一起使用,它运行良好,但我需要禁用某些用户的所有表输入(只读 View )。
有没有办法完全禁用 handsontable,这样所有输入都没有响应并且删除行插件不起作用?我试过http://dougestep.com/dme/jquery-disabler-widget-demos这似乎不起作用并且http://malsup.com/jquery/block/#element这有效,但它实际上在控件上创建了一个 iframe 覆盖,并且使用 removerow 插件,位置设置不正确。
最佳答案
为了完全“禁用”Handsontable,我做了以下操作:
hot.updateSettings({
readOnly: true, // make table cells read-only
contextMenu: false, // disable context menu to change things
disableVisualSelection: true, // prevent user from visually selecting
manualColumnResize: false, // prevent dragging to resize columns
manualRowResize: false, // prevent dragging to resize rows
comments: false // prevent editing of comments
});
关于javascript - 完全禁用手持设备,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22453244/