问题描述
我刚刚开始将handsontable与JSON数据一起使用,并且工作得很好,但是我需要禁用对某些用户的所有表输入(只读视图).
I have just started using handsontable with JSON data and its working great but I need to disable all table input to certain users (read-only view).
是否有一种方法可以完全禁用handontable,以便所有输入均不响应,并且remove row插件不起作用?我已经尝试过 http://dougestep.com/dme/jquery-disabler-widget-demos 似乎无效,并且 http://malsup.com/jquery/block/#元素起作用,但实际上它会在控件上创建一个iframe叠加层,而使用removerow插件时,位置设置不正确.
Is there a way to completely disable a handsontable so none of the inputs respond and the remove row plugin doesn't function? I have tried http://dougestep.com/dme/jquery-disabler-widget-demos which doesn't seem to work and http://malsup.com/jquery/block/#element which works but it essentially creates an iframe overlay over the controls and with the removerow plugin the position is off set incorrectly.
推荐答案
要完全禁用" Handsontable,我需要执行以下操作:
To fully "disable" a Handsontable I have done the following:
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
});
这篇关于完全禁用handsontable的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!