receiving the value enum that comes from the datatable

receiving the value enum that comes from the datatable

klermannklermann Posts: 277Questions: 67Answers: 1

Hello Allan, I am having difficulty receiving the value that comes from the datatable in editor when trying to edit the item the field is this: repetirPorPeriodo, in the field has a select, and I am not able to set it as received value.
ec2-54-157-236-83.compute-1.amazonaws.com:8080/financeiro/receitas

listRP[0] = { "label": "DIA", "value": "1" }; listRP[1] = { "label": "SEMANA", "value": "2" }; listRP[2] = { "label": "MES", "value": "3" }; editor.field('receitaFixaTempo').update(listRP);

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,627Questions: 1Answers: 10,090 Site admin
    Answer ✓

    You are attempting to set the label as the value (again :)). That doesn't work.

    This is your list of options:

                    listRP[0] = { "label": "DIARIO", "value": "1" };
                    listRP[1] = { "label": "SEMANAL", "value": "2" };
                    listRP[2] = { "label": "QUINZENAL", "value": "3" };
                    listRP[3] = { "label": "MENSAL", "value": "4" };
                    listRP[4] = { "label": "SEMESTRAL", "value": "5" };
                    listRP[5] = { "label": "ANUAL", "value": "6" };
    

    If you want "MENSAL" to be selected, you would need to give the value as "4"! That's what the list of options say.

    If you just want the value to be "MENSAL", then change the value to match that and it will work.

    Allan

  • klermannklermann Posts: 277Questions: 67Answers: 1

    Thank you Allan, it was lack of attention!

This discussion has been closed.