Skip to content

Checkbox attribute #645

Answered by dansysanalyst
musumbidenis asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @musumbidenis,

You must specify the primary key, read more here and set your "id" in the showCheckBox method.

The documentation needs some clarification on this.

For example, I have created a database table restaurants with the id restaurant_id.

        Schema::create('restaurants', function (Blueprint $table) {
            $table->id('restaurant_id');
            $table->string('name');
            $table->timestamps();
        });

This is how my PowerGrid table looks like:

<?php

final class RestaurantTable extends PowerGridComponent
{
    use ActionButton;

    public string $primaryKey = 'restaurants.restaurant_id';
    public string $sortField = 'restaurants.restaurant_id';

    p…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@musumbidenis
Comment options

Answer selected by dansysanalyst
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants