Add colspan to datatable from a json object!

Add colspan to datatable from a json object!

PalsajicocoPalsajicoco Posts: 3Questions: 0Answers: 0
edited April 2011 in TableTools
Hi,

I am adding information for the API from a json object, like sTitles, aaData ..
I need to add colspans to sTitles but I cant find how to do it, I was seeking for almost one week but no way :(
anyone can help me please, thanks.

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    The TH elements that DataTables generates do not have the option of introducing a col/rowspan. If you want colspan or rowspan attributes, you need to either define them in the plain HTML or construct the DOM using standard DOM methods before initialising the DataTable.

    Allan
  • PalsajicocoPalsajicoco Posts: 3Questions: 0Answers: 0
    Well, it seems to be a bit complicated then, because I defined a method to draw a datatable and I wanted ti to be generic, so I define everything in a json object defined seperately using xaction (pentaho). So can I do so without modifying the method to draw the datatable? like, putting attributes into a json obect then call it?
    thans for the answer
  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    No - as I say - there are no configuration options that DataTables will accept to draw a header with colspan/rowspan attributes on the cells. You need to either define them in the plain HTML or construct the DOM using standard DOM methods before initialising the DataTable.

    Allan
This discussion has been closed.