-
Notifications
You must be signed in to change notification settings - Fork 54
checkboxes is behaving strange #7
Comments
I have changed the 'view' for the checkboxes to this:
the change is:
to
seems to work :) |
please submit a pr, this is a good change |
In setFormProperties() in the FormComponent class, the checkbox type is set with default value array. When this is changed so that checkboxes is set to array everything works. public function setFormProperties($model = null) { $this->model = $model; if ($model) $this->form_data = $model->toArray(); foreach ($this->fields() as $field) { if (!isset($this->form_data[$field->name])) { $array = in_array($field->type, ['checkboxes', 'file']); $this->form_data[$field->name] = $field->default ?? ($array ? [] : null); } } } |
First things first, thank you for this package, it has cut down significantly the development time for a box standard admin panel I needed planting in a project. Second, I can confirm that I hae the same issues mentioned in this issue and that @rabol's solution is working for me too. |
I can't see the diference from current code; furthermore, it didn't work for me. Am I missing something? |
checkboxes is behaving strange:
my component:
When the form is displayed and I check one checkbox, all are selected
The text was updated successfully, but these errors were encountered: