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

ERROR Call to a member function columns() on string using Custom head and body #35

Open
twoarmtom opened this issue Feb 3, 2023 · 2 comments

Comments

@twoarmtom
Copy link

twoarmtom commented Feb 3, 2023

Using the current method described in the documentation:

<x-splade-table :for="$users">
    <x-slot name="head">
        <thead>
            <tr>
                @foreach($users->columns() as $column)
                    <th>{{ $column->label }}</th>
                @endforeach
            </tr>
        </thead>
    </x-slot>
 
    <x-slot name="body">
        <tbody>
            @foreach($users->resource as $user)
                <tr>
                    ...
                </tr>
            @endforeach
        </tbody>
    </x-slot>
</x-splade-table>

If I use a dedicated class for the instance I get the error:

Call to a member function columns() on string

If I use an inline SpladeTable class it works, but then I lose export and bulk action features.

The purpose of the override is to create a mobile responsive table using the same instance, currently needing to load two instances to get this done.

Is there a different way to allow the dedicated class instance to work with this?

@neatpro
Copy link

neatpro commented May 23, 2023

I'm getting same error.

Any word on this?

Thanks!

@neatpro
Copy link

neatpro commented May 23, 2023

This seams to fix the issue:
link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants