server side columns

server side columns

GoddardGoddard Posts: 14Questions: 6Answers: 0
edited November 2019 in Free community support

Are serverside column rendering on the roadmap?

It would be nice if columns and footers could be determined after the ajax call.

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 21,166Questions: 26Answers: 4,921
    edited November 2019 Answer ✓

    Currently you will need to use an ajax request to fetch the column header and footer info. This can then be used as part of the Datatables initialization parameters. Here is an example:
    http://live.datatables.net/qimukefe/1/edit

    The example uses the same URL as defined in the ajax option for server side processing. This is only for the example to work. You will want a specific URL that returns just the column config into. Also note that Datatables doesn't have a feature to build the footer. You will need to do that via your favorite Javascript technique.

    Don't know if there are future plans for making this an option. @allan or @colin will need to answer that.

    Kevin

  • allanallan Posts: 63,195Questions: 1Answers: 10,412 Site admin

    As Kevin says, the way to do this is make the Ajax call yourself to get the information to display in the table, including the columns and then build the DataTable based on that. We don't currently have any plans to make this directly possible in DataTables since its such an easy workaround verses potentially a lot of work in DataTables (dynamically adding and removing columns).

    The footer however we do plan to allow to be built via options in DT2. That's not going to be out for a while though, so as Kevin says, use a little Javascript to build it for the moment.

    Allan

This discussion has been closed.