Need to create variable with multiple checkbox selected values of igCombo

570 views Asked by At
var selectedoptions = $("#spanid").igCombo("option","multiSelection")

Variable selectedoptions has an igCombo data structure but I need this variable to have string values of the checkbox users select. I am not able to get the correct values. any help?

Ignite UI is the library in case if anyone is wondering.

1

There are 1 answers

0
Konstantin Dinev On BEST ANSWER

The multiSelection option will give you the configuration object for the multiple selection in the igCombo. In order to extract the selected items you need to use the selectedItems API method.

var items = $(".selector").igCombo("selectedItems");
var firstItemData = items[0].data;
var $firstItemLi = items[0].element;

https://www.igniteui.com/help/api/2017.2/ui.igcombo#methods:selectedItems