Radiogroup widget afterRender code undone on value change
See original GitHub issueIn order to restyle a radio button I added an extra span after it, in the otherwise default Bootstrap structure. This lets me style the radio button with input + span
and input:checked + span
without using any extra JavaScript to rebuild the default behavior.
To add this extra span in Survey JS I used the widget approach, targeting all radiogroups:
var widget = {
name: 'radiogroup-styling',
isFit: function (question) {
return question.getType() === 'radiogroup';
},
isDefaultRender: true,
afterRender: function(question, el) {
$(el).find('input').after('<span/>');
}
};
This works like a charm, until you click a radio button/change the value. Then the extra span disappears and only the original Survey JS DOM structure remains. I have created a CodePen to show the issue: http://codepen.io/Wimski/pen/YVzzZW
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Radiogroup widget afterRender code undone on value change
@WimWidgets hello! This is a bug. We fixed it in 2b8b28a. Thanks, as a workaround you can use isDefaultRender: false and render your...
Read more >Ext.form.RadioGroup | Ext JS 6.2.0 - Sencha Documentation
Specifies the number of columns to use when displaying grouped checkbox/radio controls using automatic layout. This config can take several types of values:....
Read more >Handle the Value Change Event - DevExtreme - DevExpress
To process a new RadioGroup value, you need to handle the value change event. ... assign it to the onValueChanged option when you...
Read more >How to use custom checked or ticked event of radiogroup in ...
Anyone can tell me how can we use custom checked event or any other event so we will call the change event only...
Read more >updateRadioGroupButtons: Change the value of a radio group ...
The session object passed to function given to shinyServer . Default is getDefaultReactiveDomain() . inputId. The id of the input object.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@WimWidgets we’ve released v.0.12.8. It is works now. Example pen: http://codepen.io/anon/pen/xdxBdo
@WimWidgets hello! This is a bug. We fixed it in 2b8b28ab932a3c0901977247fbad428d861cc2fc. Thanks, as a workaround you can use isDefaultRender: false and render your markup.