Open GiselleSerate opened 6 years ago
I figured out that I can manually set the checkedness of each radio button with
opt.inputs.rad0.selected = true
in the show function for the entire context menu, but I would imagine that the setInputValues
function should still work? I'm not sure if I'm missing something major here.
Maybe related, maybe not Check out these fiddles
https://jsfiddle.net/xba5u4kf/ This one has NO events defined, and here the checkbox ('Boolean') and radiobutton ('Radio2') are selected as defined Changing the state of a checkbox or radiobutton has NO effect, after closing and opening the contextmenu, the default state is restored
https://jsfiddle.net/xpvt214o/659394/ This is the same set up, however WITH events defined. Now the checkbox ('Boolean') and radiobutton ('Radio2') AREN'T selected, although defined Changing the state of a checkbox or radiobutton HAS effect, after closing and opening the contextmenu, the changed state is maintained
We were able to solve above issue by saving the state of the data, see https://jsfiddle.net/jm89vft5/
If I want to set the checkedness of a radio button that's in a submenu, the general events show and hide for the entire context menu doesn't seem to be able to set the data. I've also tried using
getInputValues()
to get the values once I've checked one of the radio buttons, but it's returning a blank object as well. What's the best way to do this?It would be less nice, but is there a way of using each radio button's events to get the variable on show? What about checking on showing the submenu? (I tried using events > show for both of these, but perhaps I didn't do it properly.)
The structure of my context menu is replicated below. Thank you in advance.