Okay
  Public Ticket #2824613
Sub-tables (nested)
Closed

Comments

  • Daniel Lindley started the conversation

    I have a master table. This currently pulls records from sub tables to make editing easier and save re-typing the same information. As present this is the only way i use sub-tables. I do want to add additional data in other tables that are linked to this master table.

    For example:

    the master table contains the master record for an individual

    eg: name, type, date etc

    I would like to add a sub table that would add multiple additional records that are linked to the individual's master record

    eg: 

    individual (linked by primary key & hidden), date, weight

    I would like this to display front end as either a nested table that expands when selected or a hyperlink for a  modal that adds this additional data in. Ive attached a mock up of what im trying to achieve. Any help from here would be kindly appreciated

    Thanks

    Dan

  •  2,507
    Aleksandar replied

    Hello Dan

    I am sorry to disappoint you, but unfortunately, something like this is not possible with the plugin's built-in features.

    The plugin can't create sub-tables like that. You would be able to link the columns using the foreign key feature, but displaying the details as you did in the mock-up is not possible.

    To display the hidden columns, you could use our paid add-on Master-Detail that would only display the values. Adding them (if you allow editing for these hidden columns) would have to be done from within the same edit modal as they would be a part of the master table.

    Kind Regards, 

    Aleksandar Vuković
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables

  • Daniel Lindley replied

    Hi Aleksandar

    Thanks again for your response. the support here is amazing!

    Is there anything i can do to make the many fields appear neater on the modal?

    like to hide/collapse by section?

    the majority of what will be done in this table is input rather than view data. I like the master tables plugin but it seems as though it makes the viewing of data better, rather than the inputting.

    Thanks again

    dan

  •  2,507
    Aleksandar replied

    Hey Daniel

    I'm glad to hear that you're satisfied with support!

    To change the appearance of the modal, you'd need to use custom CSS. Collapsing by section within the modal, however, is not possible, and that also would have to be achieved with some custom code (custom JS in this case).


    Kind Regards, 

    Aleksandar Vuković
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables

  • Daniel Lindley replied

    is there anyway that the code you gave me previously (to hide a field) can be used, maybe to have a row of hyperlinks that could "undo" the CSS or switch the fields back on?

    <a href=" some clever code = unhide field1, field2, field3"> This link</a> 
    <a href ="same = unhide field 6, field 7 field 8"> different link</a>

    I have many more fields i'd like to add to my table and the only two ways i can think to do this would be to embed into the table i already have or use a linked table but the data doesnt display correctly on SQL queries etc only showing the primary key ID.

  •  2,507
    Aleksandar replied

    Hello Daniel

    I don't quite understand what you're referring to and what you'd like to achieve. Can you please provide me some screenshots, and explain in a bit more detail?

    It seems that what you're looking for to achieve is not possible, but I can't say for sure since I don't quite understand the request.

    Kind Regards, 

    Aleksandar Vuković
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables

  • Daniel Lindley replied

    Thanks again for the reply Aleksandar

    I was trying to achieve something like a toggle switch (either button or link) that would hide columns on the front end so that i could put the table into sections in order to cut down the amount of visible fields.

    im desperately trying to think of a way to have the table (with many fields) display better than it does presently. the modal is very large and I would like it to be much smaller.

    For example the modal could display the master info (first set of fields ) and then those below would be collapsable 

    Then [Additional info] - On/off toggle ( a group of fields)
    And [More info] - On/off toggle ( final group of fields)

    another idea came to mind would be to have the same table display differently on different pages. i dont know if this is possible with the SQL query as if i recall, theyre not editable?

    I could say have 

    Page 1 [master info] - (first set of columns from table)
    Page 2 [additional info] - (next set of columns from table)
    Page 3 [More info] - (final set of columns from table)


    Thank again, any advice you may have how i could achieve this would be great


    Dan

  •  2,507
    Aleksandar replied

    Hey Daniel

    You could use that approach.

    Tables created using MySQL queries can be editable if you're only pulling one database table (so, no JOINs, UNIONs, etc) and if you have a unique auto-increment column that will be used for row IDs.

    Either way, even if it's not editable, you can create multiple tables from the same database table. First table:

    SELECT column1, column2, column3 FROM databaseTable

    Second table:

    SELECT column4, column5, column6 FROM databaseTable

    Third table:

    SELECT column7, column8, column9 FROM databaseTable

    Then, using different shortcodes, you would add them on different pages.

    Kind Regards, 

    Aleksandar Vuković
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables