Nativescript-filterable-listpicker - 2 instances


#1

Hi,
Does this pllugin allows to have 2 drop fields ?
For me first one is working, but the second will never show, without any erroros.

@davecoffin, can you assist ? Thank you.

<StackLayout class="single fields">
                    <Label text="Country"></Label>
                    <Label class="fake-text"  tap="{{showPicker}}" text="{{ country }}"></Label>
                    <ui:FilterableListpicker id="myfilter"  blur="light" hintText="Type to filter..." source="{{listitems}}" itemTapped="{{itemTapped}}" />
                </StackLayout>

                <StackLayout class="single fields">
                    <Label text="US State (if applicable)"></Label>
                    <Label class="fake-text"  tap="{{showUS}}" text="{{ country }}"></Label>
                    <ui:FilterableListpicker id="USfilter"  blur="light" hintText="Type to filter..." source="{{listitems}}" itemTapped="{{itemTapped}}" />
                </StackLayout>

#2

No, don’t do that. Use only ONE instance and Just change listitems. When user taps to select country, change listitems to countries then show the picker. Same with state. Then in the itemTapped, handle your selection. In this case I’d set some property to indicate what the user is choosing (country or state) and check that in itemTapped and use args.selectedItem to set the state or country. Make sense?


#3

Makes sense. Thank You !