Hey there, Awesome Customers!

Just a heads up: We'll be taking a breather to celebrate International Workers' Day (May 1st and 2nd - Wednesday and Thursday) and Orthodox Easter from Good Friday (May 3rd) through Easter Monday (May 6th). So, from May 1st to May 6th, our team will be off enjoying some well-deserved downtime.

During this time, our customer support will be running on a smaller crew, but don't worry! We'll still be around to help with any urgent matters, though it might take us a bit longer than usual to get back to you.

We'll be back in action at full throttle on May 7th (Tuesday), ready to tackle your questions and requests with gusto!

In the meantime, you can explore our documentation for Amelia and wpDataTables. You'll find loads of helpful resources, including articles and handy video tutorials on YouTube (Amelia's YouTube Channel and wpDataTables' YouTube Channel). These gems might just have the answers you're looking for while we're kicking back.

Thanks a bunch for your understanding and support!

Catch you on the flip side!

Warm regards,

TMS

Okay
  Public Ticket #2507750
Foreign Key data not showing up in select box
Closed

Comments

  • George started the conversation

    I have 2 problems that may keep me from continuing to use WPDataTables.

    Consider a site with two WPDataTable:

    1. Table1 has 1 column:
      1. Name (String)
    2. Table2 has 2 columns:
      1. Name (String Foreign Key to Table1 edited as a Single select Drop-down select list)
      2. Phone (String)

    First, when a page contains shortcodes for both tables on it, rows from the related foreign key do not show up in the select box when the foreign key row is created on the same page that the related row is created without a page refresh in between when the foreign key row was entered and the related row is created. That is, when we add a row to Table1 and then, without refreshing the page, attempt to add a row to Table2, the row just added to Table1 does not appear in the drop-down select box for Name in Table2.

    I believe the problem here is that the domain for Table2.Name is pre-loaded when the page is loaded and not when a new Table2 row is created. We need an option to force Foreign Key data to be loaded when the new/edit form is presented to the user for entry.

    Second, there appears to be no referential integrity maintained when a row from Table1 is deleted and it is referred to by one or more rows in Table2. In my opinion, there needs to be some kind of referential integrity rule established for the relationship. Either Refuse the Delete, Cascade the delete, or set the Foreign Key to NULL. Regardless of the option selected, again in my opinion, the foreign key should not just be left as-is (pointing to a row that will never be re-created).

  • George replied

    I forgot to ask: Are there options somewhere in WPDataTables that I am missing that would alleviate either of the issues?

    Thanks

  •  2,498
    Aleksandar replied

    Hello George

    Thank you for your purchase.

    Unfortunately, this is how the plugin works at the moment. Since both tables are on the same page, the second table wouldn't be able to pull the newly entered data without the page (or table) refresh.

    In fact, even if they were on separate pages, you would still need to refresh table #2 to pull the new data. Currently, there are no built-in features to fix this.

    You can add auto-refresh to the second table, and when the table is reloaded after that amount of time, the data will be shown.

    I will pass this info to our developers, in hope they can fix it for one of the future versions.

    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