Checkboxed not populating in Editor

Checkboxed not populating in Editor

SEMA Data CoopSEMA Data Coop Posts: 1Questions: 1Answers: 0

Hello,

I am working on building a custom template for my Editor form. The Editor contains fields that are not displayed in the Datatable. I have two checkboxes that are on the Editor (but not displayed in the Datatable). The checkboxes are saving back to the server correctly when updating, but are always shown as empty/unchecked in the Editor. In my DB, these fields are stored as Bools so I have set my options as follows in my .js file:
{ label: "Requires Agreement:",
name: "RequiresAgreement", type: "checkbox",
separator: "|", options: [
{ label: '', value: 'true' } ]
``` }

This is ensuring when I save these fields, that 'true' is sent back to the server, but I believe it is not getting populated on my form because it is expecting 1 or 0? Is there simple solution to having this look at true/false instead? Similar to how my 'options' is helping send it to the server that way?

Thank you,
Dylan C.

Answers

  • allanallan Posts: 61,860Questions: 1Answers: 10,135 Site admin

    Hi Dylan,

    It is possible that it is something as simple as 1/0 rather than true/false or 'true'/'false'. What does the JSON from the server return when you are loading records when a checked value? The value property would need to match that.

    Allan

This discussion has been closed.