Skip to content

Commit

Permalink
feat: add resetRowHeights api method
Browse files Browse the repository at this point in the history
  • Loading branch information
hyyan committed Mar 7, 2020
1 parent 9d41a74 commit 19b3d67
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 5 deletions.
12 changes: 12 additions & 0 deletions BBjGridExWidget.bbj
Expand Up @@ -2365,6 +2365,18 @@ class public BBjGridExWidget extends BBjWidget implements BBjGridExWidgetColumns
#setRowHeight(str(index!) , height!)
methodend
rem /**
rem * Reset The row heights.
rem *
rem * <br><b><small>#API</small></b>
rem *
rem * The rows height is calculated once when the data is first given to the grid.
rem * If the data changes, or the width of a column changes, then you may require the grid to calculate
rem * the height again by calling this method
rem */
method public void resetRowHeights()
#executeScript("$wnd.gw_resetRowHeights('" + #GRIDID$ + "')")
methodend
rem /**
rem * Set a sorting for one or more columns
rem *
rem * <br><b><small>#API</small></b>
Expand Down
13 changes: 12 additions & 1 deletion client/dist/bbj-grid-widget.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/dist/bbj-grid-widget.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion client/dist/report.html

Large diffs are not rendered by default.

13 changes: 11 additions & 2 deletions client/src/api/rows.js
Expand Up @@ -95,6 +95,15 @@ export function gw_setRowsData(id, json) {
options.rowData = json;
}

/**
* Reset the row height
*
* @param {String} id the grid id
*/
export function gw_resetRowHeights(id) {
gw_getGrid(id).options.api.resetRowHeights();
}

/**
* Update a row on the grid
*
Expand Down Expand Up @@ -145,12 +154,12 @@ export function gw_addRows(id, index, rows) {
*/
export function gw_setRowsHeight(id, height) {
const options = gw_getGrid(id).options;
const api = options.api;
const api = options.api;

api.forEachNode(row => {
row.setRowHeight(height);
});

api.onRowHeightChanged();
}

Expand Down

0 comments on commit 19b3d67

Please sign in to comment.