我需要在某些条件下禁用/启用输入某些列,我可以用制表器来做吗?当我打开带有某种状态(布尔值或等)的表的页面时,可用或锁定输入的列。谢谢你。
例子:
//define some sample data
var tabledata = [
{
id: 1,
name: "Oli Bob",
age: "12",
col: "red",
dob: ""
},
{
id: 2,
name: "Mary May",
age: "1",
col: "blue",
dob: "14/05/1982"
},
{
id: 3,
name: "Christine Lobowski",
age: "42",
col: "green",
dob: "22/05/1982"
},
{
id: 4,
name: "Brendon Philips",
age: "125",
col: "orange",
dob: "01/08/1980"
},
{
id: 5,
name: "Margret Marmajuke",
age: "16",
col: "yellow",
dob: "31/01/1999"
},
];
var table_3 = new Tabulator("#table_3", {
height: 205,
data: tabledata,
layout: "fitColumns",
columns: [
{
title: "Name",
field: "name",
width: 150,
editor: "input"
},
{
title: "Age",
field: "age",
align: "left",
formatter: "progress",
editor: "input"
},
{
title: "Favourite Color",
field: "col",
editor: "input"
},
{
title: "Date Of Birth",
field: "dob",
sorter: "date",
align: "center",
},
],
});
editor: "input"
在某些情况下如何禁用?