Local table editor does not support joined tables
Local table editor does not support joined tables
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
- Select a row
- Click the edit button
- Change the location
- (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
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
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
?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