Skip to content

Commit

Permalink
Merge pull request #529 from dansysanalyst/fix_demo_searchable
Browse files Browse the repository at this point in the history
Powergrid-demo: Remove searchable of the date columns and edit data block
  • Loading branch information
luanfreitasdev authored Jul 30, 2022
2 parents 5001bde + d82627d commit dfcc01e
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions resources/stubs/PowerGridDemoTable.stub
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ final class PowerGridDemoTable extends PowerGridComponent
// Demo users. Should be removed in a real project.
protected $demoUsers = null;

/**
* User name
*
* @var array<int, string> $name
*/
public array $name;

protected function getListeners()
{
return array_merge(
Expand Down Expand Up @@ -210,13 +217,11 @@ final class PowerGridDemoTable extends PowerGridComponent
->makeInputSelect($this->demoUsers(), 'state_in_usa', 'id'), //Multiselect filter

Column::make('Laracon visitor?', 'laracon')
->searchable()
->sortable()
->makeBooleanFilter('has_laracon_ticket', 'yes', 'no'), //Boolean filter based on "has_laracon_ticket".


Column::make('Laravel user since', 'laravel_since_formatted')
->searchable()
->sortable()
->makeInputDatePicker('laravel_since') //Date filter
];
Expand Down Expand Up @@ -284,6 +289,18 @@ final class PowerGridDemoTable extends PowerGridComponent
];
}

/*
|--------------------------------------------------------------------------
| ❗ Blocked update
|--------------------------------------------------------------------------
| Data update is blocked on demo to protect your database.

*/
public function onUpdatedEditable(string $id, string $field, string $value): void
{
throw new \Exception(' Data update is blocked on demo to protect your database!');
}

/*
|--------------------------------------------------------------------------
| ❗ Demo Users (Should be removed in a real project)
Expand Down

0 comments on commit dfcc01e

Please sign in to comment.