nativescript-filter-select icon indicating copy to clipboard operation
nativescript-filter-select copied to clipboard

Programatically set 'selected' when 'multiple' = false

Open tylerablake opened this issue 7 years ago • 1 comments
trafficstars

Hi,

I've tried setting the 'selected' property but doesn't work for me. Selected takes in an array of values, and since my filter select has multiple="false". I tried setting an array with just the selected item then setting the filterSelect.selected property but it isn't updating the label on the UI..

var selectedItem = new Array<PartyFilterSelectItem>();

selectedItem.push(new PartyFilterSelectItem(this.motorCarrierId, this.motorCarrierName));

let responsiblePartyFilterSelect = <any>this.page.getViewById('bookingResponsiblePartyFilterSelect'); responsiblePartyFilterSelect.selected = selectedItem;

Any help would be appreciated, thanks!

tylerablake avatar Oct 17 '18 17:10 tylerablake

@tylerablake can you make example here https://play.nativescript.org so i can help you faster

moayadnajd avatar Oct 23 '18 11:10 moayadnajd