Open vidyambala opened 6 years ago
@vidyambala
Maybe you can find an idea using the snippet below as a guide.
In the component tag <ng2-dual-list-box ...>, you can do something like <ng2-dual-list-box #test ...>.
Then plug it in some method you are using, say (click)=startTask(test, ...)
Then inside the method you can do startTask(test: DualListBoxComponent, ...) { test.selectedItems = [insert preset values here]; }
I tried this but it is not working
<ng2-dual-list-box #courseList [data]="source" valueField="id" textField="name" [(ngModel)] = "selected" (onAvailableItemSelected)="listlog($event)" (onSelectedItemsSelected)="listlog($event)" (onItemsMoved)="listlog($event)">
I am passing courseList from function and in TS I wrote
this.target = [ { id: 4, name: 'qwe' }, { id: 5, name: 'qwe Horn' }, { id: 6, name: 'qwe' }, ];
this.selected = [...this.target]
courseList.selectedItems = this.selected
@akshaydusane How I can use this using ngFor for angular 5
since there is no good answer here I edited the library and fixed the problem, if any one need My fixed version just write it here
Hi,I want to display default values on the selected items on page load?? any idea
since there is no good answer here I edited the library and fixed the problem, if any one need My fixed version just write it here
is there any fixed version?
Set values in the selected items container is not working. Tried both ngModel and formControlName.