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

Assign Id to table ? #13

Open
tayyabhussain opened this issue Apr 21, 2016 · 2 comments
Open

Assign Id to table ? #13

tayyabhussain opened this issue Apr 21, 2016 · 2 comments

Comments

@tayyabhussain
Copy link

How can I assign an id to a table. I am creating a table like
return view('admin.booking.list', [ 'table' => \App::make('table')->create($this->getBookingManager()->getAllByAdmin()) ]);

@gbrock
Copy link
Owner

gbrock commented Apr 21, 2016

There's currently no way to do this short of creating a custom view and hard-coding the ID, like so:

$table = Table::create();
$table->setView('tables/custom_table');

// views/tables/custom_table.blade.php:
<table class="{{ $class or 'table' }}" id="assigned_id">
// ...copy the rest of the file from the default view

I will leave this issue open so that ID setting can be included in a future release.

@tayyabhussain
Copy link
Author

right now, I'm creating table this way by sending array of objects to the view..
`<?php if ($table->getRows()->count()) {

        $table->setColumns(['shop_id']);
        $table->addColumn('unhashed_password', 'Password');
        $table->addColumn('system', 'Shop System', function ($model) {
            if ($model->system) {
                return $model->system->name;
            }

            return '';
        });
   }`

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

No branches or pull requests

2 participants