Answer the question
In order to leave comments, you need to log in
How to change css option in Select2 kartik?
Good day.
Select2 is created on the page
echo $form->field($modelForm, 'applicationTypeId')->widget(\kartik\widgets\Select2::classname(), [
'data' => $modelForm->selectSaleType,
'pluginOptions' => [
'width' => '155px'
],
'pluginEvents' => [
// "select2:open" => "function() { }",
// "select2:close" => "function() {}",
],
'options' => ['placeholder' => 'All', 'multiple' => true],
]);
Answer the question
In order to leave comments, you need to log in
Found a solution. Suddenly a coma is necessary. It's not as elegant but it works. It is necessary to insert in the description of Select2
'pluginEvents' => [
"select2:open" => 'function() { $(".select2-results__options").css("max-height","2000px") }',
],
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question