javascript - Select2 selected options with ajax -


i'm using select2 generic filters. options server ajax request, need set selected options data cookie.

i'm trying with:

$("#categoriesselector").select2("val",["01002"]); $("#categoriesselector").val(["01002"]); $("#categoriesselector").select2().val(["01002"]); 

but not works. idea happening? thanks, iván.

from select2 docs have set data when calling select2, so:

$('#categoriesselector').select2({   data: [     {       id: '01002',       text: '01002'     }   ] }); 

Comments

Popular posts from this blog

wireshark - USB mapping with python -

c++ - nodejs socket.io closes connection before upgrading to websocket -

Deploying Qt Application on Android is really slow? -