Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Select numric values in a ListBox from an Extension

Greetings!

I have have a list which contains Numeric values and I want to select a specific value on that list my extension code.

As of now, I'm using the SelectText method of the JS API but the result is not accurate. Let's say I passed 2 on SelectText the listbox filters all the items on the listbox which starts with 2 examples are 22,200,23 etc..

Please see below code for my codes

var doc = Qv.GetCurrentDocument();

var lb = doc.GetObject("LB01");

lb.SetOnUpdateComplete(listboxUpdated);

function listboxUpdated() {

     var arrRecords=["1","2"]

     this.Data.SelectTexts(arrRecords);

}

I tried using the SelectValues(arrRecords, false) method but no success yet.

SelectValues_Error.jpg

Please check below code for the SelectValues method

function listboxUpdated() {    

     var arrRecords=[1,2]

     this.Data.SelectValues(arrRecords,false);

}

Could anyone please help shed some light how to select numeric values from my Extension?

Thank you.

Regards,

Arnold

0 Replies