From 14a37d75d4746e5f46fa084bbbfc56c7518297c4 Mon Sep 17 00:00:00 2001 From: Grace951 Date: Fri, 16 Dec 2016 10:20:29 +0800 Subject: [PATCH 1/4] check changing of visible --- modules/griddle.jsx.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/griddle.jsx.js b/modules/griddle.jsx.js index 1e22a78a..8fd52e92 100644 --- a/modules/griddle.jsx.js +++ b/modules/griddle.jsx.js @@ -41,6 +41,7 @@ var initial = require('lodash/initial'); var intersection = require('lodash/intersection'); var isArray = require('lodash/isArray'); var isEmpty = require('lodash/isEmpty'); +var isEqual = require('lodash.isequal'); var isNull = require('lodash/isNull'); var isUndefined = require('lodash/isUndefined'); var omit = require('lodash/omit'); @@ -405,7 +406,9 @@ var Griddle = React.createClass({ } else if (this.columnSettings.allColumns.length > 0) { this.columnSettings.allColumns = []; } - + if ( !isEqual(this.props.columns.slice().sort() , nextProps.columns.slice().sort())){ + this.setColumns(nextProps.columns); + } if (nextProps.selectedRowIds) { var visibleRows = this.getDataForRender(this.getCurrentResults(nextProps.results), this.columnSettings.getColumns(), true); From 726c31de585a25a3ec6139846624a3d9316f0f5a Mon Sep 17 00:00:00 2001 From: Grace951 Date: Thu, 22 Dec 2016 16:28:11 +0800 Subject: [PATCH 2/4] add table-resopnsive clas --- modules/gridTable.jsx.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/gridTable.jsx.js b/modules/gridTable.jsx.js index 4cfead26..bf9c7acb 100644 --- a/modules/gridTable.jsx.js +++ b/modules/gridTable.jsx.js @@ -270,7 +270,7 @@ var GridTable = React.createClass({ tableStyle.tableLayout = "fixed"; } - return React.createElement('div', null, React.createElement('table', { className: this.props.className, style: this.props.useGriddleStyles && tableStyle || null }, tableHeading), React.createElement('div', { ref: 'scrollable', onScroll: this.gridScroll, style: gridStyle }, React.createElement('table', { className: this.props.className, style: this.props.useGriddleStyles && tableStyle || null }, nodes, loadingContent, pagingContent))); + return React.createElement('div', {className: 'table-resopnsive'}, React.createElement('table', { className: this.props.className, style: this.props.useGriddleStyles && tableStyle || null }, tableHeading), React.createElement('div', { className: 'table-resopnsive', ref: 'scrollable', onScroll: this.gridScroll, style: gridStyle }, React.createElement('table', { className: this.props.className, style: this.props.useGriddleStyles && tableStyle || null }, nodes, loadingContent, pagingContent))); } return React.createElement('div', { ref: 'scrollable', onScroll: this.gridScroll, style: gridStyle }, React.createElement('table', { className: this.props.className, style: this.props.useGriddleStyles && tableStyle || null }, tableHeading, nodes, loadingContent, pagingContent)); From 34fceb1f0d169d3e05668ec946736533b80d2182 Mon Sep 17 00:00:00 2001 From: Grace951 Date: Thu, 22 Dec 2016 16:36:32 +0800 Subject: [PATCH 3/4] add table-resopnsive clas --- modules/gridTable.jsx.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/gridTable.jsx.js b/modules/gridTable.jsx.js index bf9c7acb..e78bac66 100644 --- a/modules/gridTable.jsx.js +++ b/modules/gridTable.jsx.js @@ -273,7 +273,7 @@ var GridTable = React.createClass({ return React.createElement('div', {className: 'table-resopnsive'}, React.createElement('table', { className: this.props.className, style: this.props.useGriddleStyles && tableStyle || null }, tableHeading), React.createElement('div', { className: 'table-resopnsive', ref: 'scrollable', onScroll: this.gridScroll, style: gridStyle }, React.createElement('table', { className: this.props.className, style: this.props.useGriddleStyles && tableStyle || null }, nodes, loadingContent, pagingContent))); } - return React.createElement('div', { ref: 'scrollable', onScroll: this.gridScroll, style: gridStyle }, React.createElement('table', { className: this.props.className, style: this.props.useGriddleStyles && tableStyle || null }, tableHeading, nodes, loadingContent, pagingContent)); + return React.createElement('div', { className: 'table-resopnsive', ref: 'scrollable', onScroll: this.gridScroll, style: gridStyle }, React.createElement('table', { className: this.props.className, style: this.props.useGriddleStyles && tableStyle || null }, tableHeading, nodes, loadingContent, pagingContent)); } }); From 1afacb1996ffb42447967f6bf86ac0ba5c424b16 Mon Sep 17 00:00:00 2001 From: Grace951 Date: Thu, 22 Dec 2016 16:50:23 +0800 Subject: [PATCH 4/4] add table-resopnsive class --- modules/gridTable.jsx.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/gridTable.jsx.js b/modules/gridTable.jsx.js index e78bac66..510b9674 100644 --- a/modules/gridTable.jsx.js +++ b/modules/gridTable.jsx.js @@ -270,10 +270,10 @@ var GridTable = React.createClass({ tableStyle.tableLayout = "fixed"; } - return React.createElement('div', {className: 'table-resopnsive'}, React.createElement('table', { className: this.props.className, style: this.props.useGriddleStyles && tableStyle || null }, tableHeading), React.createElement('div', { className: 'table-resopnsive', ref: 'scrollable', onScroll: this.gridScroll, style: gridStyle }, React.createElement('table', { className: this.props.className, style: this.props.useGriddleStyles && tableStyle || null }, nodes, loadingContent, pagingContent))); + return React.createElement('div', {className: 'table-responsive'}, React.createElement('table', { className: this.props.className, style: this.props.useGriddleStyles && tableStyle || null }, tableHeading), React.createElement('div', { className: 'table-responsive', ref: 'scrollable', onScroll: this.gridScroll, style: gridStyle }, React.createElement('table', { className: this.props.className, style: this.props.useGriddleStyles && tableStyle || null }, nodes, loadingContent, pagingContent))); } - return React.createElement('div', { className: 'table-resopnsive', ref: 'scrollable', onScroll: this.gridScroll, style: gridStyle }, React.createElement('table', { className: this.props.className, style: this.props.useGriddleStyles && tableStyle || null }, tableHeading, nodes, loadingContent, pagingContent)); + return React.createElement('div', { className: 'table-responsive', ref: 'scrollable', onScroll: this.gridScroll, style: gridStyle }, React.createElement('table', { className: this.props.className, style: this.props.useGriddleStyles && tableStyle || null }, tableHeading, nodes, loadingContent, pagingContent)); } });