Posted 2 March 2021, 10:16 am EST
Hi,
I am using wijmo listbox with typescript code. I am using a textbox and wijmo listbox. The issue I am facing is whenever I add a record to listbox from textbox , that record is always on focus. I want to focus the record only when its selected.How can I resolve this?
I have attached a file .
Code=>
fullname: string;
addRecord() {
this.recordData.push(this.fullname);
this.name = new CollectionView(this.recordData);
this.saveListBoxData();
}
updateRecord() {
//let lb = this.name1;
let textBoxValue = this.fullname || “”;
if (textBoxValue) {
let cv = this.ListData.collectionView;
cv.items[this.ListData.selectedIndex] = textBoxValue;
cv.refresh();
this.saveListBoxData();
}
}
removeRecord() {
let lb = this.ListData.collectionView;
lb.items.splice(this.ListData.selectedIndex, 1);
lb.refresh();
this.ListData.selectedIndex = -1;
this.fullname = ’ ';
this.saveListBoxData();
}
displayListBoxValueInTextField(listBox) {
this.fullname = listBox.selectedValue;
}
HTML-<input type=“text” [(ngModel)]=“fullname”
style=“width: 540px; height: 30px; margin-left: 30px;”>
<wj-list-box #ListData [itemsSource]=“name” (initialized)=“initListBox(ListData)”
(selectedIndexChanged)="displayListBoxValueInTextField(ListData)"> <ng-template wjItemTemplate let-item="item" let-itemIndex="itemIndex"> {{item}} <div class="wj-glyph"> <span class="wj-glyph-drag"></span> </div> </ng-template> </wj-list-box>
Thank You.
Regards,
Nivisha