examples: Destroy and Create swith a new set of data

examples: Destroy and Create swith a new set of data

rldean1rldean1 Posts: 141Questions: 66Answers: 1

I think I want to destroy a table on screen, then initialize a new table with a different set of data. Sometimes, there might be totally different columns, other times, the columns will be the same. The request for new data will be associated with row clicks, and button presses.

How do I approach this? What documentation or examples should I reference?

I understand destroy(). I know how to initialize a table with HTML and associated JS/jQuery.

I don't know how to create a new table in the same space where the old one existed.

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,176Questions: 1Answers: 2,589

    Hi @raydlevel5 ,

    This thread here would at StackOverflow. You'd create the table element within a div wrapper that's positioned where you want it.

    Cheers,

    Colin

  • rldean1rldean1 Posts: 141Questions: 66Answers: 1

    Hey @colin ,

    My question was not well thought out. I should have started a discussion. I'm being pedantic.

    Ultimately, I'm curious to know how folks are bringing tables into, and out of, existence.

    Like, do folks store a table in a variable, and then call it to life when needed, then destroy() it later?

  • allanallan Posts: 61,928Questions: 1Answers: 10,153 Site admin
    Answer ✓

    For the case you describe, where you might have different tables with different columns then yes, creating and then destroying the table is probably the way to go.

    If you simply have a collection of tables inside tabs, then just create all of them, but if you have a dynamic single page app, then you'll probably need to create and destroy the tables as you show different parts of the app.

    Allan

This discussion has been closed.