这是我的表格代码,我想重新编写表格以仅接受数字而不接受任何特殊字符
table headers and table definition's
this.beltTabulatorHeaders = [
{
title: "Type", field: "name", headerHozAlign: "left", width: "55%", headerSort: false, hozAlign: "left", editable: false
},
{
title: "Value", headerHozAlign: "center", width: "45%",
columns: [
{
title: "Min", field:"minValue",cellEdited: validateBelt, validator:numericValidator,editable:editCheck,editor: "input", headerSort: false, width: "15%", hozAlign: "right", formatter:
decimalFormatter
, headerHozAlign: "right"
, editorParams: {
formatter: decimalFormatter,
},
},
{
title: "Nom", field: "nomValue",cellEdited: validateBelt, editor: "input", headerSort: false, width: "15%", hozAlign: "right", formatter: decimalFormatter, headerHozAlign: "right"
, editorParams: {
formatter: decimalFormatter
}
},
{
title: "Max", field:"maxValue",cellEdited: validateBelt, editable:editCheck,editor: "input", headerSort: false, width: "15%", hozAlign: "right", formatter: decimalFormatter, headerHozAlign: "right"
, editorParams: {
formatter: decimalFormatter
}
},
],
},
];
this.beltTabulatorTable = new Tabulator("#beltTabulatorTable", {
maxHeight: "100%",
maxWidth: "100%",
data: beltTableData,
layout: "fitDataTable",
headerSort: false,
columns: this.beltTabulatorHeaders,
responsiveLayout: false,
})
以上是表格代码
您可以使用
numeric
编辑器来执行此操作,它将插入数字类型输入而不是文本类型输入:
{title:"Example", field:"example", editor:"number", editorParams:{
min:0,
max:100,
step:10,
}}
完整详细信息可以在编辑器文档
中找到