javascript - how can I apply Datatable jquery on asp.net GridView? -
<asp:gridview id="grddonationrequests" runat="server" selectmethod="grddonationrequests_getdata" autogeneratecolumns="false" allowpaging="true" pagersettings-mode="numericfirstlast" pagesize="10" datakeynames="donationrequestid" itemtype="tayf.models.donationrequest" allowsorting="true" width="100%" cssclass=" table-striped table-condensed table table-bordered table-hover" meta:resourcekey="grddonationrequestsresource1">
i tried
$(function () { $("#<%=grddonationrequests.clientid%>").prepend( $("thead>/thead>").append($(this).find("tr:first"))).datatable({ }); });
but gives me error uncaught typeerror: cannot read property 'classname' of undefined
update:-
when tried '$("#<%=grddonationrequests.clientid%>").datatable({ "aasorting": [] });'
gives me no error draw gridview datatable display empty
i in process of doing thing right now. following code required convert gridview datatable:
$(document).ready(function () { var table = $('#your_gridview_id').datatable();
hope helps!
Comments
Post a Comment