Initialize dynamically created table using ajax
Initialize dynamically created table using ajax
ghaly
Posts: 4Questions: 0Answers: 0
I am calling blade view which has the table element, then initialize dataTable on that table.
I did a waiting 2-3 seconds in order for table tag to be created, with no success!
Kindly assist,
http://live.datatables.net/titarano/1/edit
This discussion has been closed.
Replies
I just found the datatables debugger so I made one from my real script (not the one on live.datatables site).
https://debug.datatables.net/uraxov
If you pop open the console in your browser you'll see an error such as:
That is the reason it isn't loading. You would either need to have the data source on the same domain as the data being requested, use a proxy or enable CORS at end point.
Allan
Thanks @allan , what I posted on datatables-live was an example which has CORS problem.
But my issues was that I added dataset attributes to
<table>
tag, which apparently did conflict somewhere.So, I did not read that
<table>
tag can not have attributes more than "class" and "id".It can: http://live.datatables.net/jenanuha/1/edit . What attributes were you using that was causing the issue.
Allan
I am using dataset for example data-script, data-whatever
well it doesn't work as you can see here
http://live.datatables.net/jenanuha/2/edit
we need to click run js because I am disabling autoexecute
You will be interested to read the Options set by HTML5 data attributes. For example
data-ajax
is causing the Ajax error.Kevin