jsonform icon indicating copy to clipboard operation
jsonform copied to clipboard

Bug with checkboxbuttons default values

Open adam-clarey opened this issue 8 years ago • 2 comments

Currently default values will only be applied if there is more than one field set as 'checked'.

I've found and fixed the issue and supplied the patch. Essentially, the onBeforeRender function expects the values to be in an array, but a single value does not appear in an array. checkboxes-defaults.patch.txt

adam-clarey avatar Jun 03 '16 09:06 adam-clarey

Correction patch, the values need to be in an array, so this patch puts a single value into an array checkboxes-defaults.patch.txt

adam-clarey avatar Jun 03 '16 10:06 adam-clarey

checkboxbuttons expect the value be an array.

so either your default value, or the preloaded value, should be an array. it's not the code's responsibility to fix the value type imo.

2016-06-03 18:10 GMT+08:00 adam-clarey [email protected]:

Correction patch, the values need to be in an array, so this patch puts a single value into an array checkboxes-defaults.patch.txt https://github.com/ulion/jsonform/files/297376/checkboxes-defaults.patch.txt

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ulion/jsonform/issues/33#issuecomment-223542150, or mute the thread https://github.com/notifications/unsubscribe/AAKsHaS6TByWQ5DN5eLuJN2s3GD6pr4Yks5qH_2QgaJpZM4ItWQt .

Ulion

ulion avatar Jun 03 '16 10:06 ulion