I want to get some default values whenever select2 box loads just like in the image, Is there a way to do this? Then when I click on the box the dropdown should show as usual with other values.
I tried by giving multiselect
Select2::create(array(
'name'=>"roles",
"multiple"=>true,
"placeholder"=>"Select roles",
"multiSelect"=>array("default1","default2","default3"),
"data"=>$this->params()["adminRoles"],
"dataBind"=>array("value"=>"role_id",
"text"=>"roles"
),
But its not showing