Skip to content

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 pxpm added the v7 label Oct 21, 2024
@pxpm pxpm force-pushed the datatable-single-component branch from d84d59a to 65aa57b Compare March 12, 2025 10:01
@pxpm pxpm changed the base branch from main to next March 12, 2025 10:01
@pxpm pxpm force-pushed the datatable-single-component branch from 39a4912 to d8b8d16 Compare March 24, 2025 15:17
Copy link
Member

@tabacitu tabacitu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's

  1. Polish with the comments here.
  2. Set up a demo
  • used a column in ShowOperation
  • used as a widget in ShowOperation
  • used in a dashboard as an x-component

@endif
<x-datatable :crud="$crud" />

</div>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Todo: let's write in the upgrade guide that the list.blade.php and datatables_logic.blade.php files have been turned into a datatable component - if they've made any changes to them, they can delete them from their project and re-do the changes in the component view (after publishing).

@tabacitu tabacitu moved this to In Review in Backpack v7.0 Apr 3, 2025
@tabacitu tabacitu moved this from In Review to In Progress in Backpack v7.0 Apr 3, 2025
Copy link
Member

@tabacitu tabacitu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One last push!

sport-help-gif-by-nascar

Copy link
Member

@tabacitu tabacitu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One last push!

sport-help-gif-by-nascar

@tabacitu tabacitu merged commit c80d637 into next Jun 9, 2025
27 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in Backpack v7.0 Jun 9, 2025
@tabacitu tabacitu deleted the datatable-single-component branch June 9, 2025 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants