aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/client/views/nodes/DataVizBox/components/TableBox.tsx12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/client/views/nodes/DataVizBox/components/TableBox.tsx b/src/client/views/nodes/DataVizBox/components/TableBox.tsx
index 8a99d332f..a7cc3f2fb 100644
--- a/src/client/views/nodes/DataVizBox/components/TableBox.tsx
+++ b/src/client/views/nodes/DataVizBox/components/TableBox.tsx
@@ -52,7 +52,18 @@ export class TableBox extends React.Component<TableBoxProps> {
return this._tableData.length ? Array.from(Object.keys(this._tableData[0])).filter(header => header!='') : [];
}
+ filterSelectedRowsDown() {
+ if (!this.props.layoutDoc.selected) this.props.layoutDoc.selected = new List<string>();
+ const selected = Cast(this.props.layoutDoc.selected, listSpec("string"), null);
+ const incomingSelected = this.incomingLinks.length? StrListCast(this.incomingLinks[0].selected) : undefined;
+ if (incomingSelected){
+ selected.map(guid => {
+ if (!incomingSelected.includes(guid)) selected.splice(selected.indexOf(guid), 1)}); // filters through selected to remove guids that were removed in the incoming data
+ }
+ }
+
render() {
+ this.filterSelectedRowsDown();
if (this._tableData.length>0){
return (
<div className="table-container" style={{height: this.props.height+this.props.margin.top+this.props.margin.bottom}}>
@@ -133,7 +144,6 @@ export class TableBox extends React.Component<TableBoxProps> {
if (containsData){
return (
<tr key={i} className="table-row" onClick={action(e => {
- if (!this.props.layoutDoc.selected) this.props.layoutDoc.selected = new List<string>();
const selected = Cast(this.props.layoutDoc.selected, listSpec("string"), null);
if (selected.includes(guid)) selected.splice(selected.indexOf(guid), 1);
else {