How to do dynamic column creation and load data in that column ?

How to do dynamic column creation and load data in that column ?

arsalansiddiquiarsalansiddiqui Posts: 128Questions: 15Answers: 0

Link to test case:

VIDEO:
https://streamable.com/vo0g9k

Debugger code (debug.datatables.net):

Error messages shown:

Description of problem:

I want dynamic column creation which add a row then fill column cells with respect to associated data, by doing this will take my hassle to click and load data on demand, user will only click to show that column than all that column data is displayed.

Answers

  • arsalansiddiquiarsalansiddiqui Posts: 128Questions: 15Answers: 0

    This is datatable:

    VIDEO:
    https://gofile.io/d/rbGK5c

    DataTable does not make ajax request to show/hide/generate column

  • colincolin Posts: 15,112Questions: 1Answers: 2,583
  • arsalansiddiquiarsalansiddiqui Posts: 128Questions: 15Answers: 0

    I have colvis, thats what i'm showing video in comment. I want something that's in post

  • arsalansiddiquiarsalansiddiqui Posts: 128Questions: 15Answers: 0

    Ajax based solution actually

  • colincolin Posts: 15,112Questions: 1Answers: 2,583

    I'm not too clear what you're after, you need to give longer replies saying what you're trying to do. That said, you can't add columns dynamically, and once configured, DataTables expects the data for all columns to always be returned - so even if it's not visible, the data would be expected to be in the JSON,

    Colin

  • arsalansiddiquiarsalansiddiqui Posts: 128Questions: 15Answers: 0

    got it, but dynamically creation and retrieving/rendering will give another boost to table, can it will be available in future versions.

  • colincolin Posts: 15,112Questions: 1Answers: 2,583

    That's unlikely, it's not a priority for us. That said, DataTables is open source, so you can make those changes yourself if they're necessary for you,

    Colin

This discussion has been closed.