External Source - Listbox HTML GUI SDK
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Printer Friendly Page
- Mark as New
- Subscribe to RSS Feed
- Permalink
Second question from me today.
I've previously created a HTML GUI tool which populates a dropdown using the meta-info from the macro input, and i've succesfully transferred this logic to work for a listbox; however, in this sitatuation, we want to use the option to get the data from an external source.
Could anyone advise on how I could look to do this?
At present my HTML for the listbox selector looks like...
<section>
<h2>XMSG("Select the field containing your task content")</h2>
<ayx data-ui-props='{type:"ListBox", widgetId:"TaskContent", searchable: true}' data-item-props='{dataName:"TaskContent", dataType:"FieldSelectorMulti"}'></ayx>
</section>My understanding is that it's the data-item-props that forces the widget to pull data from the meta-info, but I'm not sure how I can amend this to work with an external source.
Ben
- Labels:
- Custom Tools
- HTML GUI
- Macro
- SDK
- Mark as New
- Subscribe to RSS Feed
- Permalink
We're going deep today @BenMoss
So clearly this help is conditional on you not winning the SNES :)
You need to create the data item in JavaScript and its got some warts...
In the HTML do:
<ayx data-ui-props='{type:"ListBox", widgetId:"TaskContent", searchable: true}'></ayx>Then within Alteryx.Gui.AfterLoad, do something like:
Alteryx.Gui.AfterLoad = function(manager, AlteryxDataItems) {
# ...
var fsm = new AlteryxDataItems.FieldSelectorMulti("TaskContent", { manager: manager } )
fsm.forceFieldInFieldList({strName: "James", strType: "Int16"})
manager.addDataItem(fsm)
manager.bindDataItemToWidget(fsm, "TaskContent")
#...
}
It does seem to add missing but isnt far off what you need
You will need to amend the forceField bit to what you need
Good luck
J
- Mark as New
- Subscribe to RSS Feed
- Permalink
MAN - I am in awe of you two - lots of catching up for me to do.