multi-select icon indicating copy to clipboard operation
multi-select copied to clipboard

Where is the GetSelectedOptions Method

Open Wr4i7h opened this issue 7 years ago • 5 comments

Where is the GetSelectedOptions Method that will return the text, value pairs?

Something like $(".ms-list").children("li.ms-selected"); will only return the text propery, how do I also get the value property?

Wr4i7h avatar Aug 07 '17 13:08 Wr4i7h

how to get getSelectedOptions in .ms-selected ?

o624366705 avatar Aug 28 '17 08:08 o624366705

Just use another plugin...

Wr4i7h avatar Aug 28 '17 13:08 Wr4i7h

@Wr4i7h did you find an another interesting plugin? if yes please suggest me.

xenogew avatar Apr 26 '18 02:04 xenogew

A small hack i made.

Add into 'select' function at top of function

 var sid=this.$element[0];
 var ssid = sid.id;
 $('#'+ssid+' option[value="'+value+'"]').attr('selected','selected');

And into 'deselect':

 var sid=this.$element[0];
 var ssid = sid.id;
 $('#'+ssid+' option[value="'+value+'"]').removeAttr('selected');

After that you can just call your multiselect as $('#myMultiSelect').val() and you get the selected values.

mfoe87 avatar Sep 25 '18 15:09 mfoe87

quite simply $("#select").val() ?

lcapdecomme avatar May 05 '20 12:05 lcapdecomme