diff options
author | emkael <emkael@tlen.pl> | 2016-06-16 02:37:51 +0200 |
---|---|---|
committer | emkael <emkael@tlen.pl> | 2016-06-16 11:50:22 +0200 |
commit | 85b8b9977957f7da7ce4011f0ea10dfef1ad492a (patch) | |
tree | d231d39cd471878a13e3652d6443029b22f35c54 /app/frontend/controls/grid/GroupGridElement.php | |
parent | 0fea2103dd4cc5a04a756d5a87e26d39ea347e49 (diff) |
* controls for rendering grouped grid view
Diffstat (limited to 'app/frontend/controls/grid/GroupGridElement.php')
-rw-r--r-- | app/frontend/controls/grid/GroupGridElement.php | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/app/frontend/controls/grid/GroupGridElement.php b/app/frontend/controls/grid/GroupGridElement.php new file mode 100644 index 0000000..dc92239 --- /dev/null +++ b/app/frontend/controls/grid/GroupGridElement.php @@ -0,0 +1,23 @@ +<?php + +Prado::using('Application.controls.grid.GridElement'); + +class GroupGridElement extends GridElement { + + public function onPreRender($param) { + parent::onPreRender($param); + $this->GroupEvents->setDataSource($this->Data->Events); + $this->GroupEvents->dataBind(); + } + + public function stripPrefix(string $string) { + return preg_replace( + '#^' . preg_quote($this->Data->Header) . '\s*#', + '', + $string + ); + } + +} + +?> |