Trouble styling tables collected from php Ajax source.

Trouble styling tables collected from php Ajax source.

AlawrenceAlawrence Posts: 18Questions: 0Answers: 0
edited March 2011 in General
First off let me apologize as I am fairly new to all of this. We have been using data tables for a while now and have had great success. However we have currently run into a situation where a more dynamic feel is needed. We found the need to refresh the table without refreshing the entire page. So we turned to Ajax to solve this issue. Which worked perfectly as far as returning table data sourced from a php file which built the table and passed it back. However where we have now hit a snag is applying the styling back to the data that has been returned. No matter what I try I end up with a style free table. After some tinkering it seems to be that it has to do with the scripts not running for the data that is collected through Ajax. If we build the table on the main page there are no issues, but as soon as we scrap that and collect the table from Ajax source we lose styling.

Replies

  • GerardoGerardo Posts: 66Questions: 0Answers: 0
    try fnRowCallback and fnDrawCallback, maybe also fnRender

    See http://datatables.net/examples/api/highlight.html, http://datatables.net/examples/advanced_init/highlight.html, and http://datatables.net/examples/advanced_init/row_callback.html

    Hth,
    Gerardo
  • AlawrenceAlawrence Posts: 18Questions: 0Answers: 0
    Thanks Gerardo,

    We ended up building off the Server Side Example and finally got it.
This discussion has been closed.