Change the datatable layout by inserting a column without changing the server side script.

Change the datatable layout by inserting a column without changing the server side script.

ciccocicco Posts: 3Questions: 2Answers: 0

Hi,
I have a datatable with 18 columns, so from 0 to 17, (with many hidden) with a server side control of order and filter based on data-column value. Now I need to change the layout of datatable inserting a column in second position.I would not change all the server side control.
Is there a way to force the index of this new column, in second position, to be, in my example, the number 18?
Andrea

Answers

  • colincolin Posts: 15,142Questions: 1Answers: 2,586

    Hi @cicco ,

    The easiest way would be if your server returned an object - that way the elements can be in any order, see an example here.

    If not, just change the order of the array, as in this example here (I've flipped columns 2 and 5).

    Cheers,

    Colin

This discussion has been closed.