I have the following code:
JavaScript:
<script src="../js/plugins/datatables/jquery.dataTables.js" type="text/javascript"></script>
<script src="../js/plugins/datatables/dataTables.bootstrap.js" type="text/javascript"></script>
<script type="text/javascript">
$(function () {
$('#example2').dataTable({
"bPaginate": true,
"bLengthChange": false,
"bFilter": true,
"bSort": false,
"bInfo": false,
"bAutoWidth": false
});
});
</script>
GridView:
<asp:GridView ID="example2" runat="server" CssClass="table table-bordered table-hover" AutoGenerateColumns="false" OnRowCreated="OnDataBound" OnPreRender="GridView1_PreRender" ShowHeaderWhenEmpty="true">
<Columns>
<asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="40">
<ItemTemplate>
<input type="hidden" id="ih1_<%#Eval("S_ID")%>" name="ih1_<%#Eval("S_ID")%>" value='<%# Container.DataItemIndex %>' />
<input type="radio" id="rbTipo" name="rbTipo" value='<%#Eval("S_ID")%>'/>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField DataField="S_Desc" />
<asp:BoundField DataField="TS_Desc" />
</Columns>
</asp:GridView>
My problem is that the function in javaScript does not work or at least does not show the expected results.
I wanted to appear the pagination in the GridView, through the javaScript code that is above. What's wrong with this code? Is there a solution?
The pulneys are from the AdminLTE website.