-
-
Notifications
You must be signed in to change notification settings - Fork 221
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Rule EditOnClick and Row Enable/Disable EditOnClick
- Loading branch information
1 parent
d281750
commit 38443fd
Showing
4 changed files
with
99 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
namespace PowerComponents\LivewirePowerGrid\Components\Rules; | ||
|
||
class RuleEditOnClick extends BaseRule | ||
{ | ||
public string $forAction = RuleManager::TYPE_EDIT_ON_CLICK; | ||
|
||
public function __construct(public string|null $column) | ||
{ | ||
$this->forAction = $column; | ||
} | ||
|
||
/** | ||
* Disable the Edit On Click. | ||
*/ | ||
public function disable(): self | ||
{ | ||
$this->setModifier('field_hide_editonclick', true); | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* Enable the Edit On Click. | ||
*/ | ||
public function enable(): self | ||
{ | ||
$this->setModifier('field_hide_editonclick', false); | ||
|
||
return $this; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters