Closed TheBlueSkim closed 4 years ago
I'm so sorry, I find the option in tips.
Emmm, though I use @removable, but it also not works.
$form->image('picture')->removable();
$form->multipleImage('pictures', 'Pictures')->removable();
Test in a form , is it ok ?
In general form, it's ok, but when i use it in plugin, it not works, I found that when i select a new picture, the remove function works, but when i save the change, the old pictures are all deleted, only new picture can be saved. I have no idea with this problem now.
I has fixed it. it works now.
When I use multipleimage and multiplefile, I want to remove one item of my uploaded list, but I can't see the operation button, so I add code in Builder.php like this
if ($options) { $field = Tool::callUserfunctions($field, $options); if (!in_array($etype, ['image', 'file', 'multiple_image', 'multiple_file'])) { if ($mode == static::UPDATE) { $field->rules('required'); } } else { $field->removable(); } } else { if (in_array($etype, ['image', 'file', 'multiple_image', 'multiple_file'])) { $field->uniqueName(); $field->removable(); } else { if ($mode == static::UPDATE) { $field->rules('required'); } } }
now, I see the button, but when I click it, it not works