【问题标题】:tabulator / regex filter case insensitive?制表符/正则表达式过滤器不区分大小写?
【发布时间】:2021-02-24 16:13:17
【问题描述】:

看起来 Tabulator 的正则表达式过滤器区分大小写。有没有简单的方法让它不区分大小写?

【问题讨论】:

  • 当然,在正则表达式的开头添加(?i)
  • 有什么方法可以预设,这样用户就不必输入了?

标签: regex filter tabulator


【解决方案1】:

这就是诀窍:

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

【讨论】:

  • 我用过:RegExp(headerValue, 'i').test(value);
猜你喜欢
  • 2011-04-22
  • 2015-07-26
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-10-08
相关资源
最近更新 更多