How to populate multiple dependent and cascading select fields in Editor
How to populate multiple dependent and cascading select fields in Editor
Mesbahi
Posts: 2Questions: 1Answers: 0
I want to edit my artists data using datatables editor component,
each artist has nationality1 and nationality2 (both select tag but independent)
born country and born city (cascade select options)
die country and die city (cascade select options)
my Json data is:
{
"data": {
"countries": [
{
"id": 3,
"isoCode2": "RU",
"name": "Russia",
"nationality": "Russian",
"cities":[
{"id":10, "name":"city1"},
{"id":11, "name":"city1"},
{"id":12, "name":"city1"}
]
}
//...
],
"artists": [
{
"id": 1,
"firstName": "sampleName",
"lastName": "sampleFamily",
"gender": "male",
"nationality1Id": 1,
"nationality2Id": 1,
"bornYear": 1931,
"bornCountryId": 1,
"bornCityId": 10,
"dieYear": 2010,
"dieCountryId": 7,
"dieCityId": 24
}
//...
]
}
}
This discussion has been closed.
Answers
Does this example help?
https://editor.datatables.net/examples/advanced/joinArray.html
Kevin
no, this sample has a flat structure and doesn't have dependent dropdown, I know that I have to use dependent() API but I need a sample with dropdown control.
Multiple fields in an array is not something that Editor currently supports out of the box I'm afraid. It is a feature I will be introducing in future, but at the moment you would need to use a custom field plug-in that you write for your fields.
Regards,
Allan