angular-datatables icon indicating copy to clipboard operation
angular-datatables copied to clipboard

server side integration does not draw the records fetch to datatable it is resolved by this.rerender() but it cant be put inside the ajax response

Open awais2080 opened this issue 8 years ago • 8 comments

html code is image

typescript code is image

datatable result can be like that

image

no matching records as there are records i know it needs to this.rerender but what is the right place to do so or is there any other way

awais2080 avatar Aug 28 '18 09:08 awais2080

Did you try to put this.dtTrigger.next() after that.allMembers = resp.data["original"]["data"] ? That solved the issue for me.

elyaell avatar Aug 30 '18 15:08 elyaell

@FaithFeather bro i did it and i get error image

image

awais2080 avatar Aug 30 '18 20:08 awais2080

@FaithFeather when do it like this it keeps processsing data loads and reproces load and reproces data is reflected in datatable but its keep on calling api image

awais2080 avatar Aug 30 '18 20:08 awais2080

Looks like it's a common issue ; i put a stackblitz with the code from the documentation and, well, no-data-available is happening. So best is to wait and see a tip from @l-lin. Didn't saw it before, but there's already a ticket about this issue (#1284). You can also skip the ajax way and do it with plain angular way. I think you should also format your ticket in the template asked, 'cause else it will be flag for it.

elyaell avatar Aug 31 '18 07:08 elyaell

The "No matching record found" can be hidden with CSS. A bit "hackish", it's a workaround (see this comment).

That's why there is the following code to "compensate":

<tbody *ngIf="persons?.length == 0">
  <tr>
    <td colspan="3" class="no-data-available">No data!</td>
  </tr>
</tbody>

Check this example. If it's still not sufficient to fix your issue, then please fork it and modify it to reproduce your problem.

l-lin avatar Oct 06 '18 13:10 l-lin

The "No matching record found" can be hidden with CSS. A bit "hackish", it's a workaround (see this comment).

That's why there is the following code to "compensate":

<tbody *ngIf="persons?.length == 0">
  <tr>
    <td colspan="3" class="no-data-available">No data!</td>
  </tr>
</tbody>

Check this example. If it's still not sufficient to fix your issue, then please fork it and modify it to reproduce your problem.

With this workarround, I can't use pagination, because datatables shows 0 of 0 records yet...

sfohart avatar Nov 28 '18 11:11 sfohart

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Dec 06 '20 13:12 stale[bot]

This issue has been closed due to inactivity. Please feel free to re-open the issue to add new inputs.

stale[bot] avatar Dec 13 '20 15:12 stale[bot]