Server side processing with tbody reply possible?

Server side processing with tbody reply possible?

ignignoktignignokt Posts: 146Questions: 4Answers: 39

Right now I have the server side processing working fine. I have a few tables where it would just be so much easier if I could return the tbody chunk of data, rather than the regular data array due to already existing complex table building functions. Is there a way to do this?

For example, right now I return:
{"draw":1,"recordsTotal":4,"recordsFiltered":4,"data":[["1","316000"],["13","78500"],["14","3250"],["19","423500"]]}

I would want to be able to return something like this and it still work the same:
{"draw":1,"recordsTotal":4,"recordsFiltered":4,"data":"<tr><td>1</td><td>316000</td></tr><tr><td>13</td><td>78500</td></tr><tr><td>14</td><td>3250</td></tr><tr><td>19</td><td>423500</td></tr>"}

Answers

  • sleepingtigersleepingtiger Posts: 13Questions: 8Answers: 0

    Dont know if i am of any help, but if you are getting back html markup itself from some server call (bad idea in the first place) then why not build the table itself before you instantiate the datatable? so using jquery just add the table: $('tbody').append(data).DataTable... no?

This discussion has been closed.