Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[POC] datatable as a component for multiple cruds #5688

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

pxpm
Copy link
Contributor

@pxpm pxpm commented Oct 11, 2024

This is a very early POC about something me and @tabacitu are exploring.

What we are trying to achieve here, can be summed up in the following way:

  • re-usable Datatable
  • multiple CrudPanel instances in the same request.

They way Backpack was built from start, although simple, comes with some limitations. Now that we want to introduce more advanced features we'd need to do major refactors of the software, that would take months for us to develop, and a lot of time for our users to upgrade.

We are always exploring the possibility of changing something internal that would allow us to do more advanced things, without the cost for the developers that use our software.

That said, one of the most requested features and needs we had, was to have a "relation table", without having to develop a new table from scratch, given how much effort we already spent on the Datatable/columns, and the huge amount of features we have on both of them.

Without much to add for the moment, we will need to decide on the direction we would like to take, here is a screenshot of somewhat we want to achieve:

image

All of that, with the simplicity we aim for our software:

// in MonsterCrudController.php
$this->crud->addColumn([
            'name'        => 'crudColumn',
            'type'        => 'crud_column',
            'controller'  => IconCrudController::class,
        ]);

// in IconCrudController.php
protected function setupListOperation()
    {
        $this->crud->addColumns(['name', 'icon']);
        $this->crud->addFilter([
            'type'  => 'text',
            'name'  => 'name',
            'label' => 'Name',
        ]);
    }

At the moment there are 0 breaking changes, but also stuff that does no properly work. This is very very wip, we may find something that would require a major breaking change that we are not willing to do for the next version .. but it's a start. 👍

pxpm and others added 3 commits October 11, 2024 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

3 participants