简体   繁体   中英

How can I stop users removing cells in the header row in handsontable?

I want to make it so that the header row is not editable. I have managed to make it read only which means when they left click the cell they cannot edit it. However, they can right click the cell and choose remove row or column.

One way to do this is perhaps, intercept the bit where they remove the row or column and then check if that cell is readOnly or not. But how can I do this with Handsontables?

You can set contextMenu: false in the options, or you can configure the context menu to not display "Remove Column" and "Remove Row":

http://handsontable.com/demo/contextmenu.html

您应该使用colHeaders,因此该行不能右键单击,您可以将其定义为数组或使用函数。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM