features

features

felix_wfelix_w Posts: 1Questions: 0Answers: 0
edited March 2009 in General
Hi Allan,

thank You for Your fantastic software.

Although i have a few ideas on my wishlist:

1. Ajax source:
Include column data into sAjaxSource
{"aoColumns": ["Col1","Col2","Col3"]},
{"aaData":[["Cell1.1.", ... ,"Cell-n.3."]]}
so different tables can be rendered by the same script.

2. More tolerant against failures in column count in aoColumns and aaData
Is it possible to calculate the max column count of data and header and fill up with empty cells?

3. Rowspan of identical cells in one row while rendering, not in the data, should not cause any problems in pagination.
----------------------
| ColA | ColB | ColC |
----------------------
| Data | Data | Data |
----------------------
| AAA | Data | Data |
----------------------
| AAA | Data | Data |
----------------------
| Data | Data | Data |
----------------------

to

----------------------
| ColA | ColB | ColC |
----------------------
| Data | Data | Data |
----------------------
| AAA | Data | Data |
---------------
| | Data | Data |
----------------------
| Data | Data | Data |
----------------------

4. I would like to have a variable bHeader: top/bottom/both/none, which renders aoColumns at the top and the bottom of the table.

Would be interesting, what You think.

Regards
Felix

Replies

  • allanallan Posts: 63,489Questions: 1Answers: 10,470 Site admin
    Hi Felix,

    Thanks very much for your kind words. Your comments sound good:

    1. This is quite possible for the developer at the moment simply by doing the Ajax call before DataTables initialisation and passing the required data to the different parts of DataTables:

    [code]
    $.getJSON( sSource, null, function (json) {
    $('#example').dataTable( {
    "aoColumns": json.columns,
    "aaData": json.data
    }
    } );
    [/code]

    It's not built into DataTables, but given that it's trivial to do, I don't think there is any need to do so.

    2. It might be possible to put in empty cells, but is this not hiding an underlying problem? If there developer has made a mistake and defined the columns in the header to be different from that in the table body, then all sorts of unexpected things can start to happen. I was actually considering putting in stronger error checking for this situation to alert the developer that things might go wrong.

    3. I think this use case is somewhat of an edge case, so I probably won't include this into DataTables in future, but it can be achieved at the moment using the fnDrawCallback() function (something like what I do for the grouping example). Once the DOM has been created, you can manipulate it are required to give this effect.

    4. That's quite an interesting idea. Although isn't THEAD automatically put at the top of the table? If you want an identical footer you could then clone this element and put it into TFOOT.

    Regards,
    Allan
This discussion has been closed.