开发者

alphabetical filter in jquery datatable

I am using jquery datatable(http://datatables.net) for my asp.net mvc (C#) application.

I need to add the alphabetical list above the table 开发者_JS百科and need to filter only the list in table.

For ex.:

I am listing the list of users with Name, Email and Phone in my table. I need to use the alphabetical filter to filter by Name (i.e.) When i click the letter 'A', i need all the names starting with 'A'.

Any ideas on this?


function searchList(filtertext) {
        $(".flterableList").each(
        function() {
            var exp = new RegExp(filtertext, "i");
            $(this).show();
            if (!exp.test($(this).attr("title"))) {
                $(this).hide();
            }

        });
    }

Above is the the script that I use, .filterableList is the list you search against $(this).attr("title") is the content it filtering with

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜