Skip to content

Commit

Permalink
Resolve issue #8 -Add collapseAll and expandAll methods
Browse files Browse the repository at this point in the history
  • Loading branch information
hyyan committed Jan 17, 2018
1 parent 69634b3 commit 15fb660
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 9 deletions.
19 changes: 19 additions & 0 deletions BBjGridExWidget.bbj
Expand Up @@ -203,6 +203,25 @@ class public BBjGridExWidget extends BBjWidget
#executeScript(script$)
methodend

rem /**
rem * Expand all groups.
rem */
method public void expandAll()

script$="bbj_grid_widget_set_expand_all();"
#executeScript(script$)
methodend


rem /**
rem * collapse all groups.
rem */
method public void collapseAll()

script$="bbj_grid_widget_set_collapse_all();"
#executeScript(script$)
methodend

rem /**
rem * Event Handler for Native JavaScript Event (from the Grid)
rem * Determines and dispatches the actual event
Expand Down
26 changes: 17 additions & 9 deletions js/BBjGridExWidget.js
Expand Up @@ -140,26 +140,34 @@ function bbj_grid_widget_set_selected_rows(rows) {
}
}.bind(this));

$doc.bbj_grid_widget.api.onGroupExpandedOrCollapsed()
$doc.bbj_grid_widget.api.onGroupExpandedOrCollapsed()
}

function bbj_grid_widget_set_select_all(filtered){
if(1 === filtered) {
$doc.bbj_grid_widget.api.selectAllFiltered();
function bbj_grid_widget_set_select_all(filtered) {
if (1 === filtered) {
$doc.bbj_grid_widget.api.selectAllFiltered();
} else {
$doc.bbj_grid_widget.api.selectAll();
$doc.bbj_grid_widget.api.selectAll();
}
}

function bbj_grid_widget_set_deselect_all(filtered){
function bbj_grid_widget_set_deselect_all(filtered) {

if(1 === filtered) {
$doc.bbj_grid_widget.api.deselectAllFiltered();
if (1 === filtered) {
$doc.bbj_grid_widget.api.deselectAllFiltered();
} else {
$doc.bbj_grid_widget.api.deselectAll();
$doc.bbj_grid_widget.api.deselectAll();
}
}

function bbj_grid_widget_set_expand_all() {
$doc.bbj_grid_widget.api.expandAll();
}

function bbj_grid_widget_set_collapse_all() {
$doc.bbj_grid_widget.api.collapseAll();
}

function bbj_grid_widget_get_state() {

var state = $doc.bbj_grid_widget.columnApi.getColumnState();
Expand Down

0 comments on commit 15fb660

Please sign in to comment.