Data table api is not working on table populated from xml

Data table api is not working on table populated from xml

pathakrpathakr Posts: 3Questions: 0Answers: 0
edited July 2013 in DataTables 1.9
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

Replies

  • pathakrpathakr Posts: 3Questions: 0Answers: 0
    Hi allan..
    please suggest me the link where i can understand that how to do it...

    Thanks in advance
    pathakr
  • allanallan Posts: 63,389Questions: 1Answers: 10,449 Site admin
    Please link to a test case showing the problem: http://datatables.net/forums/discussion/12899/post-test-cases-when-asking-for-help-please-read

    Allan
  • pathakrpathakr Posts: 3Questions: 0Answers: 0
    Hi 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:
  • allanallan Posts: 63,389Questions: 1Answers: 10,449 Site admin
    Excellent - good to hear you got it working.

    Allan
This discussion has been closed.