Skip to content

Commit fe09141

Browse files
Portugal, Marcelomportuga
authored andcommitted
docs(tree-base.js): Updating documentation for treeBase feature.
1 parent 3ae224b commit fe09141

File tree

1 file changed

+19
-22
lines changed

1 file changed

+19
-22
lines changed

src/features/tree-base/js/tree-base.js

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -989,9 +989,6 @@
989989
}
990990

991991
var grid = this;
992-
var currentLevel = 0;
993-
var currentState = uiGridTreeBaseConstants.EXPANDED;
994-
var parents = [];
995992

996993
grid.treeBase.tree = service.createTree( grid, renderableRows );
997994
service.updateRowHeaderWidth( grid );
@@ -1050,7 +1047,7 @@
10501047
* @description Creates an array of rows based on the tree, exporting only
10511048
* the visible nodes and leaves
10521049
*
1053-
* @param {array} nodeList the list of nodes - can be grid.treeBase.tree, or can be node.children when
1050+
* @param {array} nodeList The list of nodes - can be grid.treeBase.tree, or can be node.children when
10541051
* we're calling recursively
10551052
* @returns {array} renderable rows
10561053
*/
@@ -1075,9 +1072,9 @@
10751072
* @methodOf ui.grid.treeBase.service:uiGridTreeBaseService
10761073
* @description Creates a tree from the renderableRows
10771074
*
1078-
* @param {Grid} grid the grid
1079-
* @param {array} renderableRows the rows we want to create a tree from
1080-
* @returns {object} the tree we've build
1075+
* @param {Grid} grid The grid
1076+
* @param {array} renderableRows The rows we want to create a tree from
1077+
* @returns {object} The tree we've build
10811078
*/
10821079
createTree: function( grid, renderableRows ) {
10831080
var currentLevel = -1;
@@ -1147,11 +1144,11 @@
11471144
* @description Creates a tree node for this row. If this row already has a treeNode
11481145
* recorded against it, preserves the state, but otherwise overwrites the data.
11491146
*
1150-
* @param {grid} grid the grid we're operating on
1151-
* @param {gridRow} row the row we want to set
1152-
* @param {array} parents an array of the parents this row should have
1153-
* @param {array} aggregationBase empty aggregation information
1154-
* @returns {undefined} updates the parents array, updates the row to have a treeNode, and updates the
1147+
* @param {grid} grid The grid we're operating on
1148+
* @param {gridRow} row The row we want to set
1149+
* @param {array} parents An array of the parents this row should have
1150+
* @param {array} aggregationBase Empty aggregation information
1151+
* @returns {undefined} Updates the parents array, updates the row to have a treeNode, and updates the
11551152
* grid.treeBase.tree
11561153
*/
11571154
addOrUseNode: function( grid, row, parents, aggregationBase ){
@@ -1185,8 +1182,8 @@
11851182
* If any node in the hierarchy is collapsed, then return collapsed, otherwise return
11861183
* expanded.
11871184
*
1188-
* @param {array} parents an array of the parents this row should have
1189-
* @returns {string} the state we should be setting to any nodes we see
1185+
* @param {array} parents An array of the parents this row should have
1186+
* @returns {string} The state we should be setting to any nodes we see
11901187
*/
11911188
setCurrentState: function( parents ){
11921189
var currentState = uiGridTreeBaseConstants.EXPANDED;
@@ -1213,8 +1210,8 @@
12131210
* We only sort tree nodes that are expanded - no point in wasting effort sorting collapsed
12141211
* nodes
12151212
*
1216-
* @param {Grid} grid the grid to get the aggregation information from
1217-
* @returns {array} the aggregation information
1213+
* @param {Grid} grid The grid to get the aggregation information from
1214+
* @returns {array} The aggregation information
12181215
*/
12191216
sortTree: function( grid ){
12201217
grid.columns.forEach( function( column ) {
@@ -1303,8 +1300,8 @@
13031300
* @description Build the object which is stored on the column for holding meta-data about the aggregation.
13041301
* This method should only be called with columns which have an aggregation.
13051302
*
1306-
* @param {Column} the column which this object relates to
1307-
* @returns {object} {col: Column object, label: string, type: string (optional)}
1303+
* @param {GridColumn} column The column which this object relates to
1304+
* @returns {object} {col: GridColumn object, label: string, type: string (optional)}
13081305
*/
13091306
buildAggregationObject: function( column ){
13101307
var newAggregation = { col: column };
@@ -1479,8 +1476,8 @@
14791476
* @methodOf ui.grid.treeBase.service:uiGridTreeBaseService
14801477
* @description Helper function used to finalize aggregation nodes and footer cells
14811478
*
1482-
* @param {gridRow} row the parent we're finalising
1483-
* @param {aggregation} the aggregation object manipulated by the aggregationFn
1479+
* @param {gridRow} row The parent we're finalising
1480+
* @param {aggregation} aggregation The aggregation object manipulated by the aggregationFn
14841481
*/
14851482
finaliseAggregation: function(row, aggregation){
14861483
if ( aggregation.col.treeAggregationUpdateEntity && typeof(row) !== 'undefined' && typeof(row.entity[ '$$' + aggregation.col.uid ]) !== 'undefined' ){
@@ -1544,8 +1541,8 @@
15441541
* @description Uses the tree aggregation functions and finalizers to set the
15451542
* column footer aggregations.
15461543
*
1547-
* @param {rows} visible rows. not used, but accepted to match signature of GridColumn.aggregationType
1548-
* @param {GridColumn} column the column we are finalizing
1544+
* @param {rows} rows The visible rows. not used, but accepted to match signature of GridColumn.aggregationType
1545+
* @param {GridColumn} column The column we are finalizing
15491546
*/
15501547
treeFooterAggregationType: function( rows, column ) {
15511548
service.finaliseAggregation(undefined, column.treeFooterAggregation);

0 commit comments

Comments
 (0)