如何在handsontable中使用handsontable禁用特定列 [英] how to disable a particular column using handsontable in handsontable

查看:613
本文介绍了如何在handsontable中使用handsontable禁用特定列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在handsontable中使用handsontable禁用特定列。我想要第一列只能编辑其他三列得到禁用。我正在使用readonly true三列,但它不起作用如何禁用....



How to disable a particular column using handsontable in handsontable.I want first column only editable other three columns get disable.I'm using readonly true for three columns but it's not work how to disable....

columns: [
         {
type:'handsontable',
handsontable: {

 colHeaders: ['EmployeeNo','EmployeeName','Department','Designation'],
 data: manufacturerData,
 columns:[{},{readOnly: true},
     {
    readOnly: true
       },
     {
   readOnly: true
     }]
    }
    },
    {}]

推荐答案

只读和禁用状态应该是相关的,但实际上它们是不同的东西。要禁用某些元素,您需要使用 .prop()方法,例如:

Read-only and disabled state should be related, but actually they are different things. To disable some element, you need to use the .prop() method, for example:
myElement =


#elementId);
myElement.prop( disabled);

// ...

myElement .prop( disabled false );
("#elementId"); myElement.prop("disabled", true); //... myElement.prop("disabled", false);





请参阅: http:/ /api.jquery.com/prop/ [ ^ ] 。



-SA


这篇关于如何在handsontable中使用handsontable禁用特定列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆