@ag-grid-community/client-side-row-model
Advanced tools
Comparing version 25.2.0 to 25.3.0
@@ -79,3 +79,3 @@ import { BeanStub, ChangedPath, IClientSideRowModel, RefreshModelParams, RowBounds, RowDataTransaction, RowNode, RowNodeTransaction } from "@ag-grid-community/core"; | ||
}; | ||
getRowNode(id: string): RowNode; | ||
getRowNode(id: string): RowNode | null; | ||
setRowData(rowData: any[]): void; | ||
@@ -82,0 +82,0 @@ batchUpdateRowData(rowDataTransaction: RowDataTransaction, callback?: (res: RowNodeTransaction) => void): void; |
@@ -138,7 +138,7 @@ "use strict"; | ||
// when changedPath is active and the rowNode is not expanded. | ||
var skipChildren = changedPath.isActive() && !rowNode.expanded; | ||
var isRootNode = rowNode.level == -1; // we need to give special consideration for root node, | ||
// as expanded=undefined for root node | ||
var skipChildren = changedPath.isActive() && !isRootNode && !rowNode.expanded; | ||
if (!skipChildren) { | ||
for (var i = 0; i < rowNode.childrenAfterGroup.length; i++) { | ||
recurse(rowNode.childrenAfterGroup[i]); | ||
} | ||
rowNode.childrenAfterGroup.forEach(recurse); | ||
} | ||
@@ -639,3 +639,20 @@ } | ||
ClientSideRowModel.prototype.getRowNode = function (id) { | ||
return this.nodeManager.getRowNode(id); | ||
// although id is typed a string, this could be called by the user, and they could have passed a number | ||
var idIsGroup = typeof id == 'string' && id.indexOf(core_1.RowNode.ID_PREFIX_ROW_GROUP) == 0; | ||
if (idIsGroup) { | ||
// only one users complained about getRowNode not working for groups, after years of | ||
// this working for normal rows. so have done quick implementation. if users complain | ||
// about performance, then GroupStage should store / manage created groups in a map, | ||
// which is a chunk of work. | ||
var res_1 = null; | ||
this.forEachNode(function (node) { | ||
if (node.id === id) { | ||
res_1 = node; | ||
} | ||
}); | ||
return res_1; | ||
} | ||
else { | ||
return this.nodeManager.getRowNode(id); | ||
} | ||
}; | ||
@@ -642,0 +659,0 @@ // rows: the rows to put into the model |
@@ -79,3 +79,3 @@ import { BeanStub, ChangedPath, IClientSideRowModel, RefreshModelParams, RowBounds, RowDataTransaction, RowNode, RowNodeTransaction } from "@ag-grid-community/core"; | ||
}; | ||
getRowNode(id: string): RowNode; | ||
getRowNode(id: string): RowNode | null; | ||
setRowData(rowData: any[]): void; | ||
@@ -82,0 +82,0 @@ batchUpdateRowData(rowDataTransaction: RowDataTransaction, callback?: (res: RowNodeTransaction) => void): void; |
@@ -136,7 +136,7 @@ var __extends = (this && this.__extends) || (function () { | ||
// when changedPath is active and the rowNode is not expanded. | ||
var skipChildren = changedPath.isActive() && !rowNode.expanded; | ||
var isRootNode = rowNode.level == -1; // we need to give special consideration for root node, | ||
// as expanded=undefined for root node | ||
var skipChildren = changedPath.isActive() && !isRootNode && !rowNode.expanded; | ||
if (!skipChildren) { | ||
for (var i = 0; i < rowNode.childrenAfterGroup.length; i++) { | ||
recurse(rowNode.childrenAfterGroup[i]); | ||
} | ||
rowNode.childrenAfterGroup.forEach(recurse); | ||
} | ||
@@ -637,3 +637,20 @@ } | ||
ClientSideRowModel.prototype.getRowNode = function (id) { | ||
return this.nodeManager.getRowNode(id); | ||
// although id is typed a string, this could be called by the user, and they could have passed a number | ||
var idIsGroup = typeof id == 'string' && id.indexOf(RowNode.ID_PREFIX_ROW_GROUP) == 0; | ||
if (idIsGroup) { | ||
// only one users complained about getRowNode not working for groups, after years of | ||
// this working for normal rows. so have done quick implementation. if users complain | ||
// about performance, then GroupStage should store / manage created groups in a map, | ||
// which is a chunk of work. | ||
var res_1 = null; | ||
this.forEachNode(function (node) { | ||
if (node.id === id) { | ||
res_1 = node; | ||
} | ||
}); | ||
return res_1; | ||
} | ||
else { | ||
return this.nodeManager.getRowNode(id); | ||
} | ||
}; | ||
@@ -640,0 +657,0 @@ // rows: the rows to put into the model |
{ | ||
"name": "@ag-grid-community/client-side-row-model", | ||
"version": "25.2.0", | ||
"version": "25.3.0", | ||
"description": "Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components", | ||
@@ -45,3 +45,3 @@ "main": "./dist/cjs/main.js", | ||
"dependencies": { | ||
"@ag-grid-community/core": "~25.2.0" | ||
"@ag-grid-community/core": "~25.3.0" | ||
}, | ||
@@ -48,0 +48,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6650213
101178
2
+ Added@ag-grid-community/core@25.3.0(transitive)
- Removed@ag-grid-community/core@25.2.0(transitive)