How to apply jQuery DataTable plugin for multiple GridViews using jQuery in ASP.Net

Last Reply on Apr 13, 2017 01:05 AM By YacharuP

Posted on Apr 12, 2017 11:28 PM

I applied jQuery to datatable plugin to a single gridview in all pages.

but some of pages have multiple gridviews so how can i apply datatable plugin to multiple gridviews?

Posted on Apr 13, 2017 01:05 AM

Finally, I found it...

<script type="text/javascript">
    $(function () {
        $('[id$=grd_booking_customer]').prepend($("<thead></thead>").append($('[id$=grd_booking_customer]').find("tr:first"))).DataTable({
            "responsive": true,
            "sPaginationType": "full_numbers",
        });
        $('[id$=grd_delivery_out]').prepend($("<thead></thead>").append($('[id$=grd_delivery_out]').find("tr:first"))).DataTable({
            "responsive": true,
            "sPaginationType": "full_numbers",
        });
    });
</script>