如何使用 handsontable 中的 handsontable 禁用特定列。我希望第一列仅可编辑,其他三列被禁用。我对三列使用 readonly true 但如何禁用它不起作用....
columns: [
{
type:'handsontable',
handsontable: {
colHeaders: ['EmployeeNo','EmployeeName','Department','Designation'],
data: manufacturerData,
columns:[{},{readOnly: true},
{
readOnly: true
},
{
readOnly: true
}]
}
},
{}]
最佳答案
在项目中,我用这行代码来完成。
cells : function(row, col, prop) {
var cellProperties = {};
if (col > 0) {
cellProperties.readOnly = true;
}
else
{
cellProperties.readOnly = false;
}
return cellProperties;
}
您可以在给定的链接上找到它的工作示例。但举个例子是将一行设置为只读。 http://handsontable.com/demo/conditional.html
关于handsontable - 如何在 handsontable 中使用 handsontable 禁用特定列,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19787297/