制表器/正则表达式过滤器不区分大小写?



看起来Tabulator的regex过滤器是区分大小写的。有没有一种简单的方法使它不区分大小写?

效果很好:

column.headerFilterFunc = function customHeaderFilter(headerValue, rowValue, rowData, filterParams){                        
return rowValue.match(new RegExp(headerValue, 'i')); 
};

function customHeaderFilter(headerValue, rowValue, rowData, filterParams) {
return RegExp(headerValue, 'i').test(rowValue);
}

var columns = [
{ title: "MyColumn", field: "fieldName", sorter: "string", headerFilter: true, headerFilterFunc: customHeaderFilter }
]

主答案导致错误"Cannot read properties of null (reading 'match')"&;如果列包含任何空值。应该使用Robert M. mnch对他的回答的评论来解决这个问题。

最新更新