@linzjs/step-ag-grid 22.2.3 → 22.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -47,7 +47,15 @@ const BooleanCellRenderer = (props: CustomCellEditorProps) => {
|
|
|
47
47
|
if (!onValueChange) return;
|
|
48
48
|
const params = props?.colDef?.cellEditorParams as GridEditBooleanEditorProps<any> | undefined;
|
|
49
49
|
if (!params) return;
|
|
50
|
-
|
|
50
|
+
// The data cannot be relied upon if grid changed whilst editing, data will be stale
|
|
51
|
+
// So I get the data from the node itself which will be up to date.
|
|
52
|
+
const selectedRows: { id: string | number }[] = [];
|
|
53
|
+
api.forEachNode((n) => {
|
|
54
|
+
if (n.data.id === data.id) {
|
|
55
|
+
selectedRows.push(n.data);
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
|
|
51
59
|
const checked = !value;
|
|
52
60
|
onValueChange(checked);
|
|
53
61
|
params.onClick({ selectedRows, selectedRowIds: selectedRows.map((r) => r.id), checked }).then();
|