Link to home
Start Free TrialLog in
Avatar of ITsolutionWizard
ITsolutionWizardFlag for United States of America

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>
Avatar of Marco Gasi
Marco Gasi
Flag of Spain image

Can you show us the code to initialize DataTable?
Avatar of ITsolutionWizard

ASKER

https://datatables.net/

I used above example on above website.
So your code is
$(document).ready(function(){
    $('#dataTables-example').DataTable();
});

Open in new window

Correct?
ASKER CERTIFIED SOLUTION
Avatar of Marco Gasi
Marco Gasi
Flag of Spain image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ok i got it thanks