jQuery Datatable搜索选项(按字母顺序排列) [英] jQuery Datatable search option ( alphabetical )

查看:83
本文介绍了jQuery Datatable搜索选项(按字母顺序排列)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用jQuery Datatables插件。

当我在搜索框中键入数据表过滤表中的所有数据包含一个字母

但是我想搜索(按字母顺序排列) br>
当我键入'a'只是过滤所有以'a'开始的数据

I use jQuery Datatables Plugin.
When I type a in search box Datatables filters all data in table contains a letter
But I want to search (alphabetical ) like this
when I type 'a' just filters all data starts with 'a'

推荐答案

然后:

oTable.fnFilter( '^a.*', yourColumn, true );

'^ a。*'正则表达式搜索,用过滤器替换a

'^a.*' the regex searching for, replace the a with your filter

yourColumn 自己说话

true 需要将第一个字符串视为正则表达式,请检查

true needed to treat the first string as a regex, check the api

这篇关于jQuery Datatable搜索选项(按字母顺序排列)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆