Skip to content

Commit

Permalink
Merged pr-302
Browse files Browse the repository at this point in the history
  • Loading branch information
joellanciaux committed Jan 5, 2016
2 parents bf33680 + fd6b1f4 commit 3d598bc
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 14 deletions.
16 changes: 9 additions & 7 deletions build/griddle.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ return /******/ (function(modules) { // webpackBootstrap
"customPagerComponent": {},
"customFilterComponent": null,
"customFilterer": null,
"globalData": null,
"enableToggleCustom": false,
"noDataMessage": "There is no data to display.",
"noDataClassName": "griddle-nodata",
Expand Down Expand Up @@ -725,8 +726,8 @@ return /******/ (function(modules) { // webpackBootstrap
getCustomGridSection: function getCustomGridSection() {
return React.createElement(this.props.customGridComponent, _extends({ data: this.props.results, className: this.props.customGridComponentClassName }, this.props.gridMetadata));
},
getCustomRowSection: function getCustomRowSection(data, cols, meta, pagingContent) {
return React.createElement('div', null, React.createElement(CustomRowComponentContainer, { data: data, columns: cols, metadataColumns: meta,
getCustomRowSection: function getCustomRowSection(data, cols, meta, pagingContent, globalData) {
return React.createElement('div', null, React.createElement(CustomRowComponentContainer, { data: data, columns: cols, metadataColumns: meta, globalData: globalData,
className: this.props.customRowComponentClassName, customComponent: this.props.customRowComponent,
style: this.props.useGriddleStyles ? this.getClearFixStyles() : null }), this.props.showPager && pagingContent);
},
Expand Down Expand Up @@ -763,11 +764,11 @@ return /******/ (function(modules) { // webpackBootstrap
hasMorePages: hasMorePages,
onRowClick: this.props.onRowClick }));
},
getContentSection: function getContentSection(data, cols, meta, pagingContent, hasMorePages) {
getContentSection: function getContentSection(data, cols, meta, pagingContent, hasMorePages, globalData) {
if (this.props.useCustomGridComponent && this.props.customGridComponent !== null) {
return this.getCustomGridSection();
} else if (this.props.useCustomRowComponent) {
return this.getCustomRowSection(data, cols, meta, pagingContent);
return this.getCustomRowSection(data, cols, meta, pagingContent, globalData);
} else {
return this.getStandardGridSection(data, cols, meta, pagingContent, hasMorePages);
}
Expand Down Expand Up @@ -823,7 +824,7 @@ return /******/ (function(modules) { // webpackBootstrap
// Grab the paging content if it's to be displayed
var pagingContent = this.getPagingSection(currentPage, maxPage);

var resultContent = this.getContentSection(data, cols, meta, pagingContent, hasMorePages);
var resultContent = this.getContentSection(data, cols, meta, pagingContent, hasMorePages, this.props.globalData);

var columnSelector = this.getColumnSelectorSection(keys, cols);

Expand Down Expand Up @@ -1984,7 +1985,8 @@ return /******/ (function(modules) { // webpackBootstrap
"data": [],
"metadataColumns": [],
"className": "",
"customComponent": {}
"customComponent": {},
"globalData": {}
};
},
render: function render() {
Expand All @@ -1996,7 +1998,7 @@ return /******/ (function(modules) { // webpackBootstrap
}

var nodes = this.props.data.map(function (row, index) {
return React.createElement(that.props.customComponent, { data: row, metadataColumns: that.props.metadataColumns, key: index });
return React.createElement(that.props.customComponent, { data: row, metadataColumns: that.props.metadataColumns, key: index, globalData: that.props.globalData });
});

var footer = this.props.showPager && this.props.pagingContent;
Expand Down
5 changes: 3 additions & 2 deletions scripts/customRowComponentContainer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ var CustomRowComponentContainer = React.createClass({
"data": [],
"metadataColumns": [],
"className": "",
"customComponent": {}
"customComponent": {},
"globalData": {}
}
},
render: function() {
Expand All @@ -25,7 +26,7 @@ var CustomRowComponentContainer = React.createClass({
}

var nodes = this.props.data.map(function(row, index){
return <that.props.customComponent data={row} metadataColumns={that.props.metadataColumns} key={index} />
return <that.props.customComponent data={row} metadataColumns={that.props.metadataColumns} key={index} globalData={that.props.globalData} />
});

var footer = this.props.showPager&&this.props.pagingContent;
Expand Down
11 changes: 6 additions & 5 deletions scripts/griddle.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ var Griddle = React.createClass({
"customPagerComponent": {},
"customFilterComponent": null,
"customFilterer": null,
"globalData": null,
"enableToggleCustom":false,
"noDataMessage":"There is no data to display.",
"noDataClassName": "griddle-nodata",
Expand Down Expand Up @@ -686,8 +687,8 @@ var Griddle = React.createClass({
getCustomGridSection: function(){
return <this.props.customGridComponent data={this.props.results} className={this.props.customGridComponentClassName} {...this.props.gridMetadata} />
},
getCustomRowSection: function(data, cols, meta, pagingContent){
return <div><CustomRowComponentContainer data={data} columns={cols} metadataColumns={meta}
getCustomRowSection: function(data, cols, meta, pagingContent, globalData){
return <div><CustomRowComponentContainer data={data} columns={cols} metadataColumns={meta} globalData={globalData}
className={this.props.customRowComponentClassName} customComponent={this.props.customRowComponent}
style={this.props.useGriddleStyles ? this.getClearFixStyles() : null} />{this.props.showPager&&pagingContent}</div>
},
Expand Down Expand Up @@ -724,11 +725,11 @@ var Griddle = React.createClass({
hasMorePages={hasMorePages}
onRowClick={this.props.onRowClick}/></div>)
},
getContentSection: function(data, cols, meta, pagingContent, hasMorePages){
getContentSection: function(data, cols, meta, pagingContent, hasMorePages, globalData){
if(this.props.useCustomGridComponent && this.props.customGridComponent !== null){
return this.getCustomGridSection();
} else if(this.props.useCustomRowComponent){
return this.getCustomRowSection(data, cols, meta, pagingContent);
return this.getCustomRowSection(data, cols, meta, pagingContent, globalData);
} else {
return this.getStandardGridSection(data, cols, meta, pagingContent, hasMorePages);
}
Expand Down Expand Up @@ -788,7 +789,7 @@ var Griddle = React.createClass({
// Grab the paging content if it's to be displayed
var pagingContent = this.getPagingSection(currentPage, maxPage);

var resultContent = this.getContentSection(data, cols, meta, pagingContent, hasMorePages);
var resultContent = this.getContentSection(data, cols, meta, pagingContent, hasMorePages, this.props.globalData);

var columnSelector = this.getColumnSelectorSection(keys, cols);

Expand Down

0 comments on commit 3d598bc

Please sign in to comment.