|
989 | 989 | } |
990 | 990 |
|
991 | 991 | var grid = this; |
992 | | - var currentLevel = 0; |
993 | | - var currentState = uiGridTreeBaseConstants.EXPANDED; |
994 | | - var parents = []; |
995 | 992 |
|
996 | 993 | grid.treeBase.tree = service.createTree( grid, renderableRows ); |
997 | 994 | service.updateRowHeaderWidth( grid ); |
|
1050 | 1047 | * @description Creates an array of rows based on the tree, exporting only |
1051 | 1048 | * the visible nodes and leaves |
1052 | 1049 | * |
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 |
1054 | 1051 | * we're calling recursively |
1055 | 1052 | * @returns {array} renderable rows |
1056 | 1053 | */ |
|
1075 | 1072 | * @methodOf ui.grid.treeBase.service:uiGridTreeBaseService |
1076 | 1073 | * @description Creates a tree from the renderableRows |
1077 | 1074 | * |
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 |
1081 | 1078 | */ |
1082 | 1079 | createTree: function( grid, renderableRows ) { |
1083 | 1080 | var currentLevel = -1; |
|
1147 | 1144 | * @description Creates a tree node for this row. If this row already has a treeNode |
1148 | 1145 | * recorded against it, preserves the state, but otherwise overwrites the data. |
1149 | 1146 | * |
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 |
1155 | 1152 | * grid.treeBase.tree |
1156 | 1153 | */ |
1157 | 1154 | addOrUseNode: function( grid, row, parents, aggregationBase ){ |
|
1185 | 1182 | * If any node in the hierarchy is collapsed, then return collapsed, otherwise return |
1186 | 1183 | * expanded. |
1187 | 1184 | * |
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 |
1190 | 1187 | */ |
1191 | 1188 | setCurrentState: function( parents ){ |
1192 | 1189 | var currentState = uiGridTreeBaseConstants.EXPANDED; |
|
1213 | 1210 | * We only sort tree nodes that are expanded - no point in wasting effort sorting collapsed |
1214 | 1211 | * nodes |
1215 | 1212 | * |
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 |
1218 | 1215 | */ |
1219 | 1216 | sortTree: function( grid ){ |
1220 | 1217 | grid.columns.forEach( function( column ) { |
|
1303 | 1300 | * @description Build the object which is stored on the column for holding meta-data about the aggregation. |
1304 | 1301 | * This method should only be called with columns which have an aggregation. |
1305 | 1302 | * |
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)} |
1308 | 1305 | */ |
1309 | 1306 | buildAggregationObject: function( column ){ |
1310 | 1307 | var newAggregation = { col: column }; |
|
1479 | 1476 | * @methodOf ui.grid.treeBase.service:uiGridTreeBaseService |
1480 | 1477 | * @description Helper function used to finalize aggregation nodes and footer cells |
1481 | 1478 | * |
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 |
1484 | 1481 | */ |
1485 | 1482 | finaliseAggregation: function(row, aggregation){ |
1486 | 1483 | if ( aggregation.col.treeAggregationUpdateEntity && typeof(row) !== 'undefined' && typeof(row.entity[ '$$' + aggregation.col.uid ]) !== 'undefined' ){ |
|
1544 | 1541 | * @description Uses the tree aggregation functions and finalizers to set the |
1545 | 1542 | * column footer aggregations. |
1546 | 1543 | * |
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 |
1549 | 1546 | */ |
1550 | 1547 | treeFooterAggregationType: function( rows, column ) { |
1551 | 1548 | service.finaliseAggregation(undefined, column.treeFooterAggregation); |
|
0 commit comments