dropdown label differs from value
dropdown label differs from value
eon_nordic_one
Posts: 5Questions: 0Answers: 0
I have a table and a dropdown in the edit form. The problem I'm having is that when chosing edit the chosen dropdown field isn't set.
I know why because in the table the json-data for the field is the same as the label and not the value hence if I change my ipOpts so that value is the same as label it will work. But I would like to have a different value sent back to the server, of course I could solve this backend but just wonder how you're suppose to think here? It's quit common to have a dropdown with a label and then a key in the value?
Hope my question makes sense, here is the code for ipOpts and in the table aaaaa etc is shown..
"ipOpts": [
{ "label": "aaaaa", "value": "1" },
{ "label": "bbbbb", "value": "7" },
{ "label": "cccccc", "value": "8" }
]
regards
/Harald
I know why because in the table the json-data for the field is the same as the label and not the value hence if I change my ipOpts so that value is the same as label it will work. But I would like to have a different value sent back to the server, of course I could solve this backend but just wonder how you're suppose to think here? It's quit common to have a dropdown with a label and then a key in the value?
Hope my question makes sense, here is the code for ipOpts and in the table aaaaa etc is shown..
"ipOpts": [
{ "label": "aaaaa", "value": "1" },
{ "label": "bbbbb", "value": "7" },
{ "label": "cccccc", "value": "8" }
]
regards
/Harald
This discussion has been closed.
Replies
https://editor.datatables.net/release/DataTables/extras/Editor/examples/join.html