Problem in DataTables

Problem in DataTables

alfaifialfaifi Posts: 1Questions: 1Answers: 0
edited July 2018 in Free community support

Hi,
I am using datatables with angular 6 and u have create a component that have two taps one for users with pointments and other tap will show all users both datatables I am binding the data in HTML page as below

<tbody>
    <tr *ngFor="let patient of patientlist">
         <td data-search="Jennifer Chang">{{patient.Patient_ID}}</td>
         <td>{{patient.Patient_Name}}</td>
         <td>{{patient.National_ID}}</td>
          <td>{{patient.Mobile_No}}</td>
          <td>{{patient.Email}}</td>
          <td>
                <button type="button" (click)="showDetectionForm(patient,2)"  class="btn btn-link">
                     <h4 class="fas fa-check-circle fa-lg"></h4>
                </button>
           </td>
    </tr>
</tbody>

The first tap with datatable for the pointments it load the data with page load and it works fine the other tap will load the data when user click on the tap it load the data and show it in the datatable but the datatable not handling the data so it give zero record , no paging and no searching, (the records is showing in the datatable.
I configue the columns as below to save the data in datatable storage :

$(document).ready(function() {
            $('#patientstb').DataTable({
              columns: [
                { data: 'Patient_ID' },
                { data: 'Patient_Name' },
                { data: 'National_ID' },
                { data: 'Mobile_No' },
                { data: 'Email' },
                { data: '' }
              ]
            } );
          });

And it work fine but in HTML I have last <td> have image with (click) event to get the select user to the other form the problem within first load the event it work but when search or move to next page the event is disabled and no action happen when clicked, what is the best solution

Best Regards

Answers

  • colincolin Posts: 15,142Questions: 1Answers: 2,586

    Hi @alfaifi ,

    That sounds like this here - can you give this a try and report back if it doesn't work.

    Cheers,

    Colin

This discussion has been closed.