SOLVED
HTML GUI SDK - Radio button default value
Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Printer Friendly Page
PetrT
Alteryx
‎08-13-2018
07:58 AM
- Mark as New
- Subscribe to RSS Feed
- Permalink
Hi,
does anybody know, how to configure default option for RadioGroup/StringSelector in HTML GUI SDK V2? It was pretty easy to do in V1, but I cannot get it to work with V2. There is no such example in sample tool and didn't find anything in documentation as well.
<ayx data-ui-props='{type:"RadioGroup", widgetId:"RG1"}' ></ayx> // Radio Group // ----------- var stringSelector1 = new AlteryxDataItems.StringSelector('RG1', { optionList: [ {label: 'XMSG("Option1")', value: "include"}, {label: 'XMSG("Option2")', value: "exclude"}, ] }) manager.addDataItem(stringSelector1) manager.bindDataItemToWidget(stringSelector1, 'RG1') // Bind to widget
Thanks
Petr
Solved! Go to Solution.
Labels:
- Labels:
- SDK
2 REPLIES 2
PaulN
Alteryx Alumni (Retired)
‎08-14-2018
07:02 AM
- Mark as New
- Subscribe to RSS Feed
- Permalink
Hi @PetrT,
Adding the following after your code should work:
window.Alteryx.Gui.Manager.getDataItem('RG1').setValue('include');
OR
window.Alteryx.Gui.Manager.getDataItem('RG1').setValue('exclude');
Thanks,
Paul Noirel
Sr Customer Support Engineer, Alteryx