From d007ede9de027807b0b28eb031bbdf175576942b Mon Sep 17 00:00:00 2001 From: Satbir Singh Date: Mon, 6 Jan 2020 06:28:52 +0000 Subject: [PATCH] Fixing selected row issue and adding multirow select --- .../designSystems/syncfusion/TableComponent.tsx | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/app/client/src/components/designSystems/syncfusion/TableComponent.tsx b/app/client/src/components/designSystems/syncfusion/TableComponent.tsx index 0ed6b96123..9545630dbb 100644 --- a/app/client/src/components/designSystems/syncfusion/TableComponent.tsx +++ b/app/client/src/components/designSystems/syncfusion/TableComponent.tsx @@ -7,6 +7,7 @@ import { Inject, Resize, Page, + SelectionSettingsModel, } from "@syncfusion/ej2-react-grids"; import * as React from "react"; import styled from "constants/DefaultTheme"; @@ -26,6 +27,9 @@ const StyledGridComponent = styled(GridComponent)` background-color: #fafafa; } `; +const settings: SelectionSettingsModel = { + type: "Multiple", +}; export default class TableComponent extends React.Component< TableComponentProps, @@ -62,6 +66,15 @@ export default class TableComponent extends React.Component< this.grid.autoFitColumns(); } }; + + shouldComponentUpdate(nextProps: TableComponentProps) { + const propsNotEqual = + JSON.stringify(nextProps.data) !== JSON.stringify(this.props.data) || + nextProps.height !== this.props.height || + nextProps.width !== this.props.width; + + return propsNotEqual; + } componentDidUpdate(prevProps: TableComponentProps) { if (prevProps.height !== this.props.height) { this.reCalculatePageSize(); @@ -70,8 +83,8 @@ export default class TableComponent extends React.Component< render() { return ( (this.grid = g)} width={this.props.width - 16}