Ajax sourced Datatable v-1.7.5 and with jquery v-1.5
Ajax sourced Datatable v-1.7.5 and with jquery v-1.5
anonymous1
Posts: 6Questions: 1Answers: 0
I am trying to create an ajax sourced datatable with datatable library v-1.7.5 and jquery library v-1.5. I am bound to use this version of library only.
Now the datatable is rendered with 'No Data Available in table' message. Please help me to solve this.
Please look on the sample code shown below,
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery DataTable</title>
</head>
<body>
userID | userName |
---|
</body>
</html>
This discussion has been closed.
Replies
DataTables 1.7.x is no longer supported. 1.10.12 is the current release. Aside from that you are assigning a data array to the
ajax
option (which btw doesn't exist in 1.7). You should usedata
(aaData in the old notation) if you want to just assign data to the table.Allan
Thanks for the reply allan.
As you said, I replaced the Datatable library with 1.10.4 and jquery library with the 1.12.3.
Now I am getting 'TypeError: g(...).on is not a function' error.
Please find the attached screen shot of the error for your reference.
I would need a link to the page shoiwng the issue please.
Also, 1.10.12 is the latest version, not 1.10.4.
Allan
Hi allan,
''TypeError: g(...).on is not a function' is because of another js library I used. After removing that library it got worked.
Now the datatable taking 30 seconds for making all the 20000 records to show in the table even after enabling "deferRender".
I feel like, it is constructing the table row only after reading all the 20000 records in the json data source.
Any idea?
I would need a link to the page showing the issue so I can see what is going on and profile it.
edit
Yes, that is correct. It has to read all of the data so it can decide what to display (i.e. sort the data set). Server-side processing is available if you want to utilize an SQL server.
Allan
Is there any way to load the data table row instantly i.e. rendering data table row after reading a json data from the data source and then reading next json data in data source?
You mean like using cursors in a file to read it line by line (e.g. C's
getline()
)? As far as I am aware that is not something HTTP supports. They ask the HTTP server for the file and it gives it to you. Only when the file has been fully downloaded will it be available for use - you can't request just parts of it (it won't be efficient over a WAN connection).Allan