How do I return a picker to its default state? (As in before any picker item has been selected)

So let's say I have:
{kind: "onyx.PickerDecorator", onSelect: "locSelected", components: [
    {content: "Location", style: "min-width: 110px;"},
    {name: "location", kind: "onyx.Picker", components: [
	{content: "0"},
        {content: "00"},
        {content: "000"},
    ]}
]}
Before selecting anything the picker displays the word "Location", after I have selected something with the picker (0, 00 or 000), how can I programmatically make it so that nothing has been selected and it displays "Location" again?

Comments

  • You can set up something like this:

    http://jsfiddle.net/JnCWS/

    Basically, you should use a blank object for the first PickerDecorator component, include the default choice in the Picker components and set its active property to true. Also, give it a name, so later when you want to set the default option again, you just run:

    this.$.theName.setActive(true);
Sign In or Register to comment.