Create List Field with values dependent on another field
Create List Field with values dependent on another field
I am hoping someone can point me in the right direction with DataTables Editor. I am using the editor locally, because it is connected to an API, so I pull down all of the data and then post it back to the API. Let's assume I have a list of items and each item can have multiple vendors:
data = [
{
itemName:'item1',
selectedVendor:'vendorA',
availableVendors: 'vendorA; vendorB; vendorC'
},
{
itemName:'item2',
selectedVendor:'vendorD',
availableVendors: 'vendorB; vendorC; vendorD'
},
{
itemName:'item3',
selectedVendor:'vendorC',
availableVendors: 'vendorA; vendorC; vendorD'
}
]
I am trying to figure out in editor how to populate a select list upon clicking with the available Vendor data and make the selectedVendor default.
I've tried 3 or 4 different options, but can't seem to make it work... Below is an example:
https://live.datatables.net/vejeqafu/73/
Thanks!
Eric
Answers
I am not sure whether I really understand what you mean, but I made your example work (it was throwing errors):
https://live.datatables.net/mojutivo/1/edit
I am exaggerating a little: The data table works now, but not the Editor. Maybe you can explain what you really want to achieve a little more?!
I will probably not be very helpful with your Editor. I've only been working with Editor on both sides: client and server - and you seem to be doing something different here.
Worth having a look at this blog post for details on how to do cascading lists as well.
Allan