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

table component should use selected value #295

Closed
jaguarman opened this issue Jul 5, 2024 · 1 comment
Closed

table component should use selected value #295

jaguarman opened this issue Jul 5, 2024 · 1 comment
Assignees
Milestone

Comments

@jaguarman
Copy link

jaguarman commented Jul 5, 2024

when using the table component with checkboxes, it should be possible to load data and use a selected value property.

like this

controller:

public function edit(string $id)
    {
        $role = Role::findOrFail($id);
        $permissions = Permission::orderBy('name')->get(['id','name']);   // all possible permissions
        $role_permissions = '2,3,6';  // selected permissions, I tried all variants below
//        $role_permissions = [2,3,6];
//        $role_permissions = [ 0 => 2, 1 => 3, 2 => 6 ];
//        $role_permissions = [ 0 => '2', 1 => '3', 2 => '6' ];
        return view('roles.edit', [
            'role' => $role,
            'permissions' => $permissions,
            'role_permissions' => $role_permissions,
        ]);
    }

blade:

<x-bladewind::card> <x-bladewind::table :data="$permissions" selected_value="{{ $role_permissions }}" name="role_permissions" selectable="true" checkable="true" divider="thin" /> </x-bladewind::card>

would be good to have a selected_value or checked_value property.

Copy link
Owner

This is a good catch @jaguarman. It was a complete oversight. I’ll add this in the next update.

@mkocansey mkocansey self-assigned this Jul 21, 2024
@mkocansey mkocansey added this to the v2.6.x milestone Jul 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

2 participants