POST option labels
POST option labels
I am trying to organise the formatting of the data I receive in as simple way as possible without too much server-side work on my end.
The responses are different depending on the action.
E.g. For create
and edit
, the response is like below:
{'data[0][tbl_tx_bets][id]': '', 'data[0][tbl_tx_bets][edit_id]': '', 'data[0][tbl_tx_bets][created_at]': '2022-04-07 15:35', 'data[0][tbl_tx_bets][sport_id]': '2' etc..
However, when I do a remove action, I get also the labels from the options too:
E.g. same as above but with the option labels, i.e. data[0][sport_id][sport_name] = "Football"
How can I get the editor to automatically send the option labels as well as the values?
I know I could add them on individual; case by case basis before the preSubmit
, so surely there must be a generic way of automatically adding them to the data response irrespective of what action is made.
Answers
What's happening here is that Editor is actually just sending the row's data on the delete action, rather than explicitly sending the labels from the select list.
There isn't a built in way to send the select label as well as the value I'm afraid.
Do you need the labels? Normally they would take their value from a left join operation, so you just need to edit the link id.
Allan
Ok thanks for the reply.
I thought that might be the case.
I have plenty of ways of extracting the labels just have to do it explicitly.
Thanks