Closed headwinds closed 7 years ago
the workaround is not use to indexes - instead the selected state of each row which is actually included within selection although its not reflected in indexes.
const selection = this.props.selection.get("workbench");
const selectionData = selection.toJS();
const selectedIds = [];
for (var key in selectionData) {
if (selectionData[key]) {
let selectedId = key.split("row-")[1];
if ("NaN" !== String(Number(selectedId))) selectedIds.push(Number(selectedId));
}
}
selectionData looks like:
{
indexes: Array[0],
lastUpdate: 6,
row-0: true,
row-1: false,
row-2: true,
row-3: true
}
This was resolved with #160
If you click the bulk check box, all the rows are visually selected but the indexes array is not available like it is when you check the rows individually.
indexes should be defined as an array with all the row indexes after clicking the bulk checkbox.
For instance, in a grid with 10 rows. If you begin with a bulk check then manually uncheck a row, you should now have 9 indexes but indexes is undefined. If you check that same row again, indexes is now defined but with 1 not 10.
@bencripps I'm going to try to fix this and update the tests. I just wanted to capture it. Please assign it to me.