Problem with getCombo and Select_Filter or Combo_Filter

Hi,

I have a Grid and populate it’s data with RoR. I’m having issues with some fields. I have 3 columns which values can be selected by a combobox (getCombo - coro type).

// Combo - Resultado grid.getCombo(6).put("1", "0 - Negativo"); grid.getCombo(6).put("2", "1 - Positivo"); // Combo - Estado Positivo grid.getCombo(7).put("1","Positivo Inconclusivo"); grid.getCombo(7).put("2", "Positivo Conclusivo"); // Combo - Motivo Rejeicao grid.getCombo(8).put("1", "Sangue Insuficiente"); grid.getCombo(8).put("2", "Sangue Sobreposto");

When the grid is loaded, for example on column 6, if the value is “0 - Negativo”, I get 3 options:

0 - Negativo
1 - Positivo
0 - Negativo

It happens exactly the same on the other options. So then, when I go to the “select_filter” or “combo_filter” and select the option (it displays correctly the two options available) the value filtered is incorrect… For example, in this case, I filter for “0 - Negativo” and get the values for “1 - Positivo” or nothing at all.

If then I changed the value on the row, the filter works correctly till the grid is reloaded. When I save the record changed on the grid, it goes correctly to the database, but when I reenter the grid I get the same filter problem…

On column 8 it works a little bit better, some of the values (i have more options than the ones shown here) it works fine, even after reloading the grid…

Do you have any suggestions on how to fix this? Any suggestion will be appreciated! Thank you

For column 6 in your grid XML you should have
1 or 2, but not the title of the select.
If the problem still occurs for you, please, provide with a complete demo, where the issue can be reproduced locally.

Hi,

Thanks for your answer.

Just to clarify, you mean I should pass to the combobox de value (1, 2, 3, …) instead of the title? That is, the field on the database should be an integer an not text? Or in the getCombo? On in the XML that loads the data from the databse?

Regards

Just to clarify, you mean I should pass to the combobox de value (1, 2, 3, …) instead of the title?
exactly

That is, the field on the database should be an integer an not text?
no matter.
mandatory: it should exactly similar. If the value of your combo is " value" in the grid cell the value should also contain the space in the beginning.

grid.getCombo(8).put(“1”, “Sangue Insuficiente”);
// put(value,title)