Closed adamkeygroup closed 6 years ago
Hi @Sirtest
It's wrong usage. Placeholder's not to be a value usually. Selectable row should be in record set. If you have to this way, you can do this with javascript.
Also you are wrong using placeholder.
Correct usage:
$categories = Category::attr([ 'class' => 'form-control error-input'])
->placeholder('0', 'Tutte le Categorie')
->selected(0)
->renderAsMultiple();
Thank you
After update doesn't work with ->selected(0) or ->selected([0])
Any suggestion ?
My Goal is to add placeholder with value = 0 and select it.
With this code the placeholder is not selected: $categories = Category::attr([ 'class' => 'form-control error-input']) ->placeholder(['0', 'Tutte le Categorie']) ->selected([0]) ->renderAsMultiple();
I wrong something?
Obviously work if I edit NESTABLESERVICE.php (VENDOR) row 310 with: if(current($this->placeholder)) { if ($this->selected == key($this->placeholder)){ $selcted_placeholder = 'selected="selected"'; }else{ $selcted_placeholder = ''; }
$tree .= '<option '.$selcted_placeholder.' value="'.key($this->placeholder).'">' . current($this->placeholder) . ''; }