Closed nageennayak11 closed 6 years ago
I'm having the same issue...
please elaborate on the issue with details to reproduce your use case consistently
First: select2 page jumps to top when clicking drop down list of single at very first time not for multiple.
Second : so i just update my plugin and then get the issue array_combine():
Sorry - cannot understand the issue as it lacks details. As mentioned, could you please share steps to clearly reproduce your issue?
You could see the various examples for the usage of the extension on the demos page ... where the issue cannot be reproduced. Compare and let know.
It happens when it is a "multiple" input with a string value, not an array.
You have to use it properly like it :
$form->field($model, 'ids[]')->widget(Select2::class, [ //The ids attribute should be an array of keys
'initValueText' => [1 => 'test'], //Here an array
'options' => [
'value' => $model->ids, //Important and should be an array of keys
'multiple' => true
],
...
It Worked ! @nageennayak11 #228
Yes a multiple select input obviously expects an array value and outputs an array as well after selection or form submission
Prerequisites
I have got the issue when i have update karthik plugin in yii2, Error is :- "array_combine(): Both parameters should have an equal number of elements"
Steps to reproduce the issue
1. 2. 3.
Expected behavior and actual behavior
When I follow those steps, I see...
I was expecting...
Environment
Browsers
Operating System
Libraries
Isolating the problem