views:

40

answers:

1

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 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?

A: 
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

D.J