【发布时间】:2021-02-24 16:13:17
【问题描述】:
看起来 Tabulator 的正则表达式过滤器区分大小写。有没有简单的方法让它不区分大小写?
【问题讨论】:
-
当然,在正则表达式的开头添加
(?i)。 -
有什么方法可以预设,这样用户就不必输入了?
看起来 Tabulator 的正则表达式过滤器区分大小写。有没有简单的方法让它不区分大小写?
【问题讨论】:
(?i)。
这就是诀窍:
column.headerFilterFunc = function customHeaderFilter(headerValue, rowValue, rowData, filterParams){
return rowValue.match(new RegExp(headerValue, 'i'));
};
【讨论】:
RegExp(headerValue, 'i').test(value);