Data table api is not working on table populated from xml
Data table api is not working on table populated from xml
pathakr
Posts: 3Questions: 0Answers: 0
I populate the table from an XML file. The data is displayed in the table. But the datatable UI features have not effect on the table. Searching, Filtering and paging is not working. I can't seem to find an exact example to match what I am needing.
Thanks
pathakr
Thanks
pathakr
This discussion has been closed.
Replies
please suggest me the link where i can understand that how to do it...
Thanks in advance
pathakr
Allan
Thanks For the reply and help. I have solved my problem and here is my code it's working now. it is useful for the person Who exactly want to do same...
Thats amazing that you alone are managing all this. Great work out there, i really appreciate this.
Below is the complete code...
Xml Code is:
<?xml version="1.0" encoding="utf-8" ?>
Richa
Pathak
richa.pathak@classicinformatics.com
987654123
Chandigarh
Rajni
Kaushal
rajni.kaushal@classicinformatics.com
987654321
Panchkula
Preeti
Verma
preeti.verma@classicinformatics.com
987612345
Mohali
Richi
Aggarwal
richi.aggarwal@classicinformatics.com
998874123
Delhi
Jquery Code:
var thisTable = $("#example").dataTable();
$.ajax({
type: "GET",
url: "Model/UserList.xml",
type: "GET",
dataType: "xml",
async: false,
success: function (response) {
var $Users = $(response).find("User");
$Users.each(function (index, User) {
var $User = $(User),
addData = [];
addData.push($User.attr("EmpID"));
$User.children().each(function (i, child) {
addData.push($(child).text());
});
thisTable.fnAddData(addData);
});
}
});
HTML:
Allan