ITsolutionWizard
asked on
asp.net repeater js datatable
I have below asp.net repeater and using js datatable.
The sorting and search textbox does not work. Anyone knows how to fix it?
Thanks,
<div class="row">
<div runat="server" id="leadList" class="col-lg-12">
<div class="panel panel-default">
<div class="panel-heading">
User Role(s) List
<!-- /.panel-heading -->
<div class="panel-body">
<div class="dataTable_wrapper">
<asp:Repeater runat="server" ID="userProfileList">
<HeaderTemplate>
<table width="100%" class="table table-striped table-bordered table-hover" id="dataTables-example">
<thead>
<tr>
<th>Role Name</th>
<th>Description</th>
<th>Begin Date</th>
<th>End Date</th>
</tr>
<tbody>
</thead>
</HeaderTemplate>
<ItemTemplate>
<tr class="grade">
<td><%# Eval("roleName") %></td>
<td><%# Eval("roleNameDescription" ) %></td>
<td><%# Eval("effectiveDate") %></td>
<td><%# Eval("expiryDate") %></td>
</tr>
</tbody>
</ItemTemplate>
<FooterTemplate>
</tbody>
</table>
</FooterTemplate>
</asp:Repeater>
</div>
</div>
<!-- /.panel-body -->
</div>
<!-- /.panel -->
</div>
</div>
</div>
The sorting and search textbox does not work. Anyone knows how to fix it?
Thanks,
<div class="row">
<div runat="server" id="leadList" class="col-lg-12">
<div class="panel panel-default">
<div class="panel-heading">
User Role(s) List
<!-- /.panel-heading -->
<div class="panel-body">
<div class="dataTable_wrapper">
<asp:Repeater runat="server" ID="userProfileList">
<HeaderTemplate>
<table width="100%" class="table table-striped table-bordered table-hover" id="dataTables-example">
<thead>
<tr>
<th>Role Name</th>
<th>Description</th>
<th>Begin Date</th>
<th>End Date</th>
</tr>
<tbody>
</thead>
</HeaderTemplate>
<ItemTemplate>
<tr class="grade">
<td><%# Eval("roleName") %></td>
<td><%# Eval("roleNameDescription"
<td><%# Eval("effectiveDate") %></td>
<td><%# Eval("expiryDate") %></td>
</tr>
</tbody>
</ItemTemplate>
<FooterTemplate>
</tbody>
</table>
</FooterTemplate>
</asp:Repeater>
</div>
</div>
<!-- /.panel-body -->
</div>
<!-- /.panel -->
</div>
</div>
</div>
Can you show us the code to initialize DataTable?
ASKER
So your code is
$(document).ready(function(){
$('#dataTables-example').DataTable();
});
Correct?
ASKER
Yes
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
ok i got it thanks