pbauerochse / searchable-option-list

a jquery plugin for a searchable optionlist
MIT License
79 stars 54 forks source link

how to use getSelection() method #27

Closed NoorUnnisa closed 8 years ago

NoorUnnisa commented 8 years ago

i want to retrieve the selected options .how do i retrieve(get/set) them

pbauerochse commented 8 years ago

You can get the selected options like this:

$('#mySolContainer').searchableOptionList().getSelection();

or

var sol = $('#mySolContainer').searchableOptionList();

// add click handler to all links present on page for demonstration purpose
$('a').on('click', function() {
   var selectedOptionsAsArray = sol.getSelection();
   // do what you need to do
});