Add a non server-side column in a server-side table

Add a non server-side column in a server-side table

SeDoSeDo Posts: 8Questions: 0Answers: 0
edited March 2011 in General
Hey,

I would like to add a column that counts the rows, see it as a first, second, third place column and continues to how many rows there are. Is this doable and how?

SeDo

Replies

  • DrakoDrako Posts: 73Questions: 0Answers: 0
    I have the same question..

    for example, my table has to show 5 columns, but my database only has 4 columns, the extra one is the sum of the the first 2 columns and doesnt come from the DB itself.

    Is it possible to use the fnServerData + getJSON (fnCallback) and edit the aoData to do this? how?

    thanks!
  • DrakoDrako Posts: 73Questions: 0Answers: 0
    edited June 2011
    figure out but having problems inserting the column in the middle of the table..
    im using fnRender

    like this
    [code]
    "aoColumns": [
    null,
    null,
    null,
    null,
    { "fnRender": function ( oObj ) {
    return 'test';
    } } ]
    [/code]

    the problem is that if i insert the Render on the middle of the table i get an error and everything after it doesnt get rendered, the aaData seems fine.
  • DrakoDrako Posts: 73Questions: 0Answers: 0
    changed to server-side according to this thread:

    http://datatables.net/forums/comments.php?DiscussionID=3072&page=1#Item_6

    but still have the same problem that i can only add columns in the end of the table.
This discussion has been closed.