0

I Used data tables in my normal table. I only used datatable [dtOptions]="dtOptions" [dtTrigger]="dtTrigger":

<table datatable [dtOptions]="dtOptions" [dtTrigger]="dtTrigger" class="table table-default table-sm table-striped">
    <tr>
        <th>Pay Units</th>
        <th>IsActive</th>
        <th></th>
        <th><i class="fa fa-rotate-right" (click)="Refresh()"></i></th>
    </tr>
    <tbody>
    <tr *ngFor="let payunit of PayUnits">
        <td>{{payunit.Name}}</td>
        <td><input type="checkbox" [(ngModel)]="payunit.IsActive"></td>
        <td><i (click)="setUpDate(payunit)" class="fa fa-edit editbtn"></i></a></td>
        <td><i (click)="delete(payunit.ID)" class="fa fa-close reject"></i></a></td>
    </tr>
    </tbody>
</table> 

but it gives error Cannot read property 'mData' of undefined how to solve this error: error in chrome developer tool

5
  • post your table code, jquery dataTables requires a well formed table. It must contain <thead> and <tbody> tags. Commented Nov 13, 2018 at 6:00
  • can you post some your code and what you try to solve this and not working if there's any, just to clarify your problem ... add your code to your post Commented Nov 13, 2018 at 6:09
  • I not added <thead> in my table. when i added as mentioned first comment, it working. thank you Commented Nov 13, 2018 at 6:11
  • 2
    notice that you should first search your question and error if you didn't get right answer then ask it here, your question is available at: stackoverflow.com/questions/25377637/… Commented Nov 13, 2018 at 6:15
  • ok i got it , thanks fateme fazli Commented Nov 13, 2018 at 6:44

1 Answer 1

1

Column miss match between angular databind and html view.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.