2 Checkboxes in Custom Field behaves not correct
2 Checkboxes in Custom Field behaves not correct
Hello,
1) at https://customer.vogeler-ag.de/vag/test/test3.html is a demonstration
2) you can mark the 1st record "Name1" and goto "Ändern". In editor-form you see the fields Name and Mitglieder
3) Mitglieder is the custom field-extension which shows a 3-column-table "BillByCategory","Billable" and "Amount"
4) the Billable-Checkbox in the first row should be checked (the data=true for this) - but it is not checked.
5) when you tick the Billable or BillbyCategory checkboxes the other one is changing the state.
Do you know why for the topics ? Can anyone help?
best regards
Volkhard
This question has an accepted answers - jump to answer
Answers
Hi Volkhard,
This is a tricky one! I believe it is because of the difference between
true
and"true"
(i.e. a primitive boolean, or a string). The options are set up as{ label: '', value: true }
, but when the value is set in the form, it is being done as a string at times. So a strict match isn't going to complete, and thusfalse
is being selected.The part that has been giving me trouble, is understanding why that string conversion is happening. I believe it is the
separator: '',
option. That isn't needed in this case, and when specified it will cause ajoin()
to be performed, resulting in a string.Could you remove that option from your plug-ins checkbox fields and see how that goes?
Allan
Hello Allen,
thanks for your support.
I was removing the separator-option on both fields. now i can´t check any checkbox - only uncheck the 1 box which is checked (see version online)
You have an idea?
Volkhard
Hi Volkhard,
Sorry about that - I'd forgotten that when there isn't a
separator
defined then thecheckbox
field type will return an array - which is causing the issue now.What to do is comment the
separator
option back in and add the followingfields.getFormatter
function for that field:I believe that should now do it. The
getFormatter
will run just after thejoin
is performed on the separator, allowing this to work.Allan
Hello Allan,
this works - thanks !
best regards
Volkhard