I am getting data by ajax to my datatable but the view is squeezed.

I am getting data by ajax to my datatable but the view is squeezed.

AsifAzizAsifAziz Posts: 8Questions: 2Answers: 0


Link to test case:
Debugger code (debug.datatables.net):
Error messages shown:
Description of problem:

Answers

  • AsifAzizAsifAziz Posts: 8Questions: 2Answers: 0

    Same setting is working fine on other pages

  • AsifAzizAsifAziz Posts: 8Questions: 2Answers: 0

    when I comment this code and give data manually to datatable then it work fine.

    "columns": [
    { "data": "Id" },
    { "data": "GrossTotal" },
    { "data": "Discount" },
    { "data": "Tax" },
    { "data": "NetTotal" },
    { "data": "IsReceived" }

                    ],
    
  • kthorngrenkthorngren Posts: 21,171Questions: 26Answers: 4,922

    A couple typical issues are that you might need to add style="width:100%" to your table tag as shown in this example. You might need to use columns.adjust(), if the table is hidden when initialized, as show in this example. These are a couple of typical issues found in the forum.

    If this doesn't help then please post a link to your page or a test case replicating the issue so we can help debug.
    https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case

    Kevin

  • AsifAzizAsifAziz Posts: 8Questions: 2Answers: 0

    Thanks a lot @kthorngren .

    Issue resolved with style=width:100%

This discussion has been closed.