mercredi 26 septembre 2018

Checkbox in Jquery Datable is not Displaying in Angular 5 app

In my angular 5 app am using jquery datable.Am using below code in my component.ts file to display datable with checkbox

 setTimeout(function(){
  $(function(){
    $('#datatable').DataTable({
      pageLength: 10,
      fixedHeader: true,
      responsive: true,
      "sDom": 'rtip',

      columnDefs: [{
          targets: 0,
          'checkboxes': true
      }],
      select:{
        'style': 'multi'
      },
      order:[[1,'asc']]
  });
  });

},0);

Below is my html code:

   <div class="table-responsive row">
     <table class="table table-bordered table-hover" id="datatable">
      <thead class="thead-default thead-lg">
       <tr>
       <th></th>
       <th>Company Name</th>
       <th>Company Code</th>
       </tr>
     </thead>
    <tbody>
     <tr *ngFor="let company of companies">
     <td></td>
     <td></td>
    <td> </td>
    </tr>
   </tbody>
   </table>
   </div>

Kindly please help me on this issue.




Aucun commentaire:

Enregistrer un commentaire