Okipa / laravel-table

Generate tables from Eloquent models.
MIT License
532 stars 64 forks source link

With this package its possible to create Table that don't refresh the page upon create? #29

Closed samuk190 closed 4 years ago

samuk190 commented 4 years ago

I didnt find anything about it

Okipa commented 4 years ago

Hi @samuk190, could you be more explicit about what you are trying to achieve (use case)? I may be able to point you in the right direction.

samuk190 commented 4 years ago

Hi @samuk190, could you be more explicit about what you are trying to achieve (use case)? I may be able to point you in the right direction.

I have a form to create a product, but each product have his own subproducts, I want to be able to add,edit, and update these subproducts when creating a new product. I tried with ajax(DataTables) but didnt manage to work with backpack admin, as it loads the datatables twice.

Okipa commented 4 years ago

Well, it seems to be an architecture question rather than this package use.

However, here is the way I would simply build this kind of architecture :

  1. I would manage the product creation without any sub-product management as my product doesn't really exist yet.
  2. I would redirect toward the product edition page after the product creation, displaying a new laravel-table with the sub-products, allowing to manage all the sub-products (creating, editing, deleting) on the related product.

As soon as you want to allow the creation of sub-products for a product that is not already created, you expose yourself to build more complicated architecture and it is sometimes not really worth it.