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

Feature : Add the possibility to add the columns to a visibility group #86

Open
alexandre-castelain opened this issue May 14, 2024 · 1 comment
Labels
feature New feature that would fit the core bundle

Comments

@alexandre-castelain
Copy link
Contributor

Hello!

It would be beneficial to add a visibility group to the table columns. This way, if a lot of information needs to be displayed in one row, it can be separated into multiple "views," allowing users to switch between them easily.

It would look like this :

$columnVisibilityGroupDefault = new ColumnVisibilityGroup('Default');
$columnVisibilityGroupAddress = new ColumnVisibilityGroup('Address');

$builder->addColumnVisibilityGroup($columnVisibilityGroupDefault);
$builder->addColumnVisibilityGroup($columnVisibilityGroupAddress);
//Or maybe
$builder->addColumnVisibilityGroups($columnVisibilityGroupDefault, $columnVisibilityGroupAddress);

$builder->addColumn('id', TextColumnType::class, [
    'column_visibility_group' => null, //No visiblity group, it's always displayed
]);

$builder->addColumn('street', TextColumnType::class, [
    'column_visibility_group' => [$columnVisibilityGroupDefault, $columnVisibilityGroupAddress],
]);

$builder->addColumn('zipCode', TextColumnType::class, [
    'column_visibility_group' => $columnVisibilityGroupAddress,
]);

By default, only one view is available, but you can add as many as needed. You then need to assign these views to the desired columns.

When multiple columnVisibilityGroup are applied to a DataTableType, a select/option is displayed in the view to switch between the visibilityGroups.

It's important to ensure the "personalization" remains customizable, allowing users to switch between views while maintaining compatibility.

What do you think about this ?

@Kreyu
Copy link
Owner

Kreyu commented May 14, 2024

Hey, cool idea, never used anything like that, but it seems very useful

@Kreyu Kreyu assigned Kreyu and unassigned Kreyu May 14, 2024
@Kreyu Kreyu added the feature New feature that would fit the core bundle label May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature that would fit the core bundle
Projects
None yet
Development

No branches or pull requests

2 participants