yajra / laravel-datatables-editor

Laravel DataTables Editor Integration.
https://yajrabox.com/docs/laravel-datatables/editor-installation
MIT License
115 stars 14 forks source link

Edit but create new #82

Closed markplus closed 5 months ago

markplus commented 11 months ago

Good morning, when you go to edit, if I wanted to create a new record leaving the existing one, how could I do it? Edit and save but add and not remove the existing one, can this be done? Save a copy of the existing one

 public function editRules(Model $model): array
    {
        return [
           'id',
           'name'
        ];
    }
yajra commented 11 months ago

Yes, you can create a duplicate button for this. See https://github.com/yajra/laravel-datatables-vite/blob/main/js/buttons/duplicate.js for ref.

markplus commented 11 months ago

Thanks for the reply, but where should I enter this code? should I create the file in the directory I view?

yajra/laravel-datatables-vite/tree/main/js/buttons)/duplicate.js
github-actions[bot] commented 6 months ago

This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] commented 5 months ago

This issue was closed because it has been inactive for 7 days since being marked as stale.