Datatable functions not working after xml request
Datatable functions not working after xml request
Farid007
Posts: 30Questions: 2Answers: 0
Link to test case:
Debugger code (debug.datatables.net):
Error messages shown:
Description of problem:
This question has accepted answers - jump to:
Answers
Datatable functions not working after xml request
The place to start is to see if you are getting errors in the browser's console.
Maybe you can provide more details around the XML request and how it relates to Datatables. Better is to provide a link to your page or a test case replaicting the issue so we can help debug.
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin
After xml file upload data table features not working or giving no data available in table
You didn't answer my questions. Do you see errors in the browser's console?
Again please provide more details about the XML upload. Datatables doesn't have an XML upload option. In order for us to debug we will need to see the problem. At a minimum post your relevant Javascript code with details of what you are doing when the error occurs. Better is a line to your page or a test case replicating the problem so we can help debug.
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin
no error giving in console
Since you don't want to provide any details I will guess the problem is you are populating the HTMl table after initializing Datatables. Datatbles doesn't know about this so it show 0 rows of data. Make sure you first populate the HTML table then initialize Datatables. If this doesn't help then you will need to provide the details requested above.
Kevin
I think you are right answer
Edited by Kevin: Syntax highlighting. Details on how to highlight code using markdown can be found in this guide
Add you Datatables initialization after this:
Kevin
Sir im calling their xml file how i initialization this first
Did you implement Kevin's suggestion. Did it work? It should do - it is correct. If it didn't please link to a test case showing the issue as Kevin has already asked for twice above.
Allan
Edited by Kevin: Syntax highlighting. Details on how to highlight code using markdown can be found in this guide
You are using an ajax request,, which is asynchronous, to fetch the data and populate the table. So you need to wait for this to complete before initializing Datatables. For example:
Please also use Markdown code formatting by placing triple back ticks (```) on new lines before and after the code block.
Kevin
How i reduce the wait for this to complete before initializing Datatables
Sir datatable search give no data found after call load data from xml file
Edited by Kevin: Syntax highlighting. Details on how to highlight code using markdown can be found in this guide
Please also use Markdown code formatting by placing triple back ticks (```) on new lines before and after the code block.
The XMLHttpRequest() request is fetching data from the server. The delay is the time it takes the server to process the request and return the data.
It doesn't look like you made the changes I suggested above. Please moving the datatables init code as I show above.
Kevin
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
};
Onclick this give this error
DataTables warning: table id=dt_basic - Cannot reinitialise DataTable. For more information about this error, please see http://datatables.net/tn/3
The first step is to review the troubleshooting steps in the link provided:
http://datatables.net/tn/3
You need to "move" the datatables init code not copy it. Remove the original initializations code.
Kevin
im very thankful to you
this runing ok
This solve my problem only give me one error
DataTables warning: table id=dt_basic - Cannot reinitialise DataTable. For more information about this error, please see http://datatables.net/tn/3
Edited by Kevin: Syntax highlighting. Details on how to highlight code using markdown can be found in this guide
Remove lines 11-17. Only initialize Datatables in the
xhttp.onreadystatechange
function.Kevin
I'm very thankful to you
My problem is solved
``` xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
}; ```
In this script datatable footer not working ok after one click
What exactly is not working. Please provide a link to your page or a running test case showing the issue so we can help debug.
https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case
Kevin
There four columns but it show 1 to 10 of 12
You asked the same question in this [thread]](https://datatables.net/forums/discussion/75270/datatable-function-not-work-proper#latest). Please don't duplicate questions. Look for my answer there.
Kevin