Skip to content

Commit

Permalink
Add addGroupBy method for DataTable
Browse files Browse the repository at this point in the history
  • Loading branch information
jcheron committed Apr 4, 2021
1 parent 346e2d7 commit 0160058
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Ajax/semantic/widgets/base/InstanceViewer.php
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,10 @@ public function getGroupByFields() {
public function setGroupByFields($groupByFields) {
$this->groupByFields = $groupByFields;
}

public function addGroupBy($groupByField){
$this->groupByFields[]=$groupByField;
}

public function getGroupByFieldsCount() {
if (is_array($this->groupByFields)) {
Expand Down
7 changes: 7 additions & 0 deletions Ajax/semantic/widgets/datatable/DataTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -711,6 +711,13 @@ public function getGroupByFields() {
public function setGroupByFields($_groupByFields) {
$this->_instanceViewer->setGroupByFields($_groupByFields);
}

public function addGroupBy($index){
$index = $this->_getIndex($index);
if ($index !== false) {
$this->_instanceViewer->addGroupBy($index);
}
}

/**
*
Expand Down

0 comments on commit 0160058

Please sign in to comment.