Dynamic dataTables example.

Dynamic dataTables example.

DatagaardDatagaard Posts: 68Questions: 20Answers: 3

I am trying to create a single web page that displays editable table contents determined from a select control.

The select control has a list of data tables that will determine what data table can be seen and changed on the page.

If each individual table is created by the generator, how would I go about utilising on one main page all of the separate generated scripts.

Hope this makes sense.

I have attached pictures as an example.

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,692Questions: 1Answers: 10,500 Site admin
    Answer ✓

    Hi,

    What you could need to do is wrap the JS code created by Generator for each of the tables into functions, so then when your change event is triggered you can call the corresponding function for the table / editor that is required.

    You would also need to destroy any existing table and clean up the HTML.

    The alternative option (since there is always more than one way of doing something) would be to allow all tables / editors to initialise immediately on page load and then show / hide each table as required by your select list (a bit like how in page tabs work).

    Allan

  • DatagaardDatagaard Posts: 68Questions: 20Answers: 3

    Thanks Allan.

    I took the first option with some slight changes. I load the appropriate js file and unload the previous selected js file in a switch case on the table in the select control.

    Works like a charm

This discussion has been closed.