Skip to content

Commit 0160058

Browse files
committed
Add addGroupBy method for DataTable
1 parent 346e2d7 commit 0160058

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

Ajax/semantic/widgets/base/InstanceViewer.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,10 @@ public function getGroupByFields() {
449449
public function setGroupByFields($groupByFields) {
450450
$this->groupByFields = $groupByFields;
451451
}
452+
453+
public function addGroupBy($groupByField){
454+
$this->groupByFields[]=$groupByField;
455+
}
452456

453457
public function getGroupByFieldsCount() {
454458
if (is_array($this->groupByFields)) {

Ajax/semantic/widgets/datatable/DataTable.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -711,6 +711,13 @@ public function getGroupByFields() {
711711
public function setGroupByFields($_groupByFields) {
712712
$this->_instanceViewer->setGroupByFields($_groupByFields);
713713
}
714+
715+
public function addGroupBy($index){
716+
$index = $this->_getIndex($index);
717+
if ($index !== false) {
718+
$this->_instanceViewer->addGroupBy($index);
719+
}
720+
}
714721

715722
/**
716723
*

0 commit comments

Comments
 (0)