Local table editor does not support joined tables

Local table editor does not support joined tables

sliekenssliekens Posts: 97Questions: 17Answers: 2
edited January 2017 in Bug reports

I noticed that when you have a complex data source, you cannot reliably use local table editing.

Repro: http://live.datatables.net/mayocawi/1/edit?js,console,output

  1. Select a row
  2. Click the edit button
  3. Change the location
  4. (Compare old value against new value in the table and console output)

Expected behavior
when changing the Location of a user, both the users.site and sites.name fields of a row are set to the selected value.

Actual behavior
only the users.site value is set to the selected value.

Example
"Pre-submit: site id = 2"
"Pre-submit: site name = London"
"Post-submit: site id = 3"
"Post-submit: site name = London"

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin

    That is correct and expected. Because the local table doesn't have access to the information required for the join it isn't possible for it to display the joined information.

    Joins only really work when you are using an Ajax data source.

    Allan

  • sliekenssliekens Posts: 97Questions: 17Answers: 2
    edited January 2017

    Then I need to find a way to interpolate the data that the local table has with the data that my app has inmemory. Maybe in the postSubmit?

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin

    Probably a rendering function would be best. You could have a Javascript variable that contains a mapping between the ids and labels, and just look up the label to display in the table based on the id value.

    Allan

This discussion has been closed.