Skip to content

Commit

Permalink
[NEW] onRowWillMount, onRowWillUnmount events; [DOCS] documentation f…
Browse files Browse the repository at this point in the history
…or onRowWillMount, onRowWillUnmount events; [FIX] GriddleGriddle#64;
  • Loading branch information
Alexander Gusev committed Aug 11, 2016
1 parent e1c8fac commit fff0495
Show file tree
Hide file tree
Showing 10 changed files with 98 additions and 14 deletions.
34 changes: 29 additions & 5 deletions build/Griddle.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,8 @@ return /******/ (function(modules) { // webpackBootstrap
"onRowClick": null,
"onRowMouseEnter": null,
"onRowMouseLeave": null,
"onRowWillMount": null,
"onRowWillUnmount": null,
/* css class names */
"sortAscendingClassName": "sort-ascending",
"sortDescendingClassName": "sort-descending",
Expand Down Expand Up @@ -901,7 +903,9 @@ return /******/ (function(modules) { // webpackBootstrap
hasMorePages: hasMorePages,
onRowClick: this.props.onRowClick,
onRowMouseEnter: this.props.onRowMouseEnter,
onRowMouseLeave: this.props.onRowMouseLeave }));
onRowMouseLeave: this.props.onRowMouseLeave,
onRowWillMount: this.props.onRowWillMount,
onRowWillUnmount: this.props.onRowWillUnmount }));
},
getContentSection: function getContentSection(data, cols, meta, pagingContent, hasMorePages, globalData) {
if (this.shouldUseCustomGridComponent() && this.props.customGridComponent !== null) {
Expand Down Expand Up @@ -1028,7 +1032,9 @@ return /******/ (function(modules) { // webpackBootstrap
"externalIsLoading": false,
"onRowClick": null,
"onRowMouseEnter": null,
"onRowMouseLeave": null
"onRowMouseLeave": null,
"onRowWillMount": null,
"onRowWillUnmount": null
};
},
getInitialState: function getInitialState() {
Expand Down Expand Up @@ -1150,7 +1156,9 @@ return /******/ (function(modules) { // webpackBootstrap
tableClassName: that.props.className,
onRowClick: that.props.onRowClick,
onRowMouseEnter: that.props.onRowMouseEnter,
onRowMouseLeave: that.props.onRowMouseLeave
onRowMouseLeave: that.props.onRowMouseLeave,
onRowWillMount: that.props.onRowWillMount,
onRowWillUnmount: that.props.onRowWillUnmount
});
});

Expand Down Expand Up @@ -6465,6 +6473,8 @@ return /******/ (function(modules) { // webpackBootstrap
"onRowClick": null,
"onRowMouseEnter": null,
"onRowMouseLeave": null,
"onRowWillMount": null,
"onRowWillUnmount": null,
"multipleSelectionSettings": null
};
},
Expand Down Expand Up @@ -6521,7 +6531,9 @@ return /******/ (function(modules) { // webpackBootstrap
onRowClick: that.props.onRowClick,
onRowMouseEnter: that.props.onRowMouseEnter,
onRowMouseLeave: that.props.onRowMouseLeave,
multipleSelectionSettings: this.props.multipleSelectionSettings }));
multipleSelectionSettings: this.props.multipleSelectionSettings,
onRowWillMount: that.props.onRowWillMount,
onRowWillUnmount: that.props.onRowWillUnmount }));

var children = null;

Expand Down Expand Up @@ -7180,9 +7192,21 @@ return /******/ (function(modules) { // webpackBootstrap
"onRowClick": null,
"multipleSelectionSettings": null,
"onRowMouseEnter": null,
"onRowMouseLeave": null
"onRowMouseLeave": null,
"onRowWillMount": null,
"onRowWillUnmount": null
};
},
componentWillMount: function componentWillMount() {
if (this.props.onRowWillMount !== null && isFunction(this.props.onRowWillMount)) {
this.props.onRowWillMount(this);
}
},
componentWillUnmount: function componentWillUnmount() {
if (this.props.onRowWillUnmount !== null && isFunction(this.props.onRowWillUnmount)) {
this.props.onRowWillUnmount(this);
}
},
handleClick: function handleClick(e) {
if (this.props.onRowClick !== null && isFunction(this.props.onRowClick)) {
this.props.onRowClick(this, e);
Expand Down
12 changes: 12 additions & 0 deletions examples/properties/properties.html
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,18 @@
"description": "A function that should be called when a mouse left a row. The 'gridRow' and event will be passed in as arguments.",
"type": "function",
"default": "null"
},
{
"property": "onRowWillMount",
"description": "A function that should be called before a row was mounted. The 'gridRow' will be passed in as argument.",
"type": "function",
"default": "null"
},
{
"property": "onRowWillUnmount",
"description": "A function that should be called before a row was unmounted. The 'gridRow' will be passed in as argument.",
"type": "function",
"default": "null"
}
];
var DefinitionItem = React.createClass({
Expand Down
14 changes: 13 additions & 1 deletion modules/gridRow.jsx.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,21 @@ var GridRow = React.createClass({
"onRowClick": null,
"multipleSelectionSettings": null,
"onRowMouseEnter": null,
"onRowMouseLeave": null
"onRowMouseLeave": null,
"onRowWillMount": null,
"onRowWillUnmount": null
};
},
componentWillMount: function componentWillMount() {
if (this.props.onRowWillMount !== null && isFunction(this.props.onRowWillMount)) {
this.props.onRowWillMount(this);
}
},
componentWillUnmount: function componentWillUnmount() {
if (this.props.onRowWillUnmount !== null && isFunction(this.props.onRowWillUnmount)) {
this.props.onRowWillUnmount(this);
}
},
handleClick: function handleClick(e) {
if (this.props.onRowClick !== null && isFunction(this.props.onRowClick)) {
this.props.onRowClick(this, e);
Expand Down
6 changes: 5 additions & 1 deletion modules/gridRowContainer.jsx.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ var GridRowContainer = React.createClass({
"onRowClick": null,
"onRowMouseEnter": null,
"onRowMouseLeave": null,
"onRowWillMount": null,
"onRowWillUnmount": null,
"multipleSelectionSettings": null
};
},
Expand Down Expand Up @@ -82,7 +84,9 @@ var GridRowContainer = React.createClass({
onRowClick: that.props.onRowClick,
onRowMouseEnter: that.props.onRowMouseEnter,
onRowMouseLeave: that.props.onRowMouseLeave,
multipleSelectionSettings: this.props.multipleSelectionSettings }));
multipleSelectionSettings: this.props.multipleSelectionSettings,
onRowWillMount: that.props.onRowWillMount,
onRowWillUnmount: that.props.onRowWillUnmount }));

var children = null;

Expand Down
8 changes: 6 additions & 2 deletions modules/gridTable.jsx.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ var GridTable = React.createClass({
"externalIsLoading": false,
"onRowClick": null,
"onRowMouseEnter": null,
"onRowMouseLeave": null
"onRowMouseLeave": null,
"onRowWillMount": null,
"onRowWillUnmount": null
};
},
getInitialState: function getInitialState() {
Expand Down Expand Up @@ -163,7 +165,9 @@ var GridTable = React.createClass({
tableClassName: that.props.className,
onRowClick: that.props.onRowClick,
onRowMouseEnter: that.props.onRowMouseEnter,
onRowMouseLeave: that.props.onRowMouseLeave
onRowMouseLeave: that.props.onRowMouseLeave,
onRowWillMount: that.props.onRowWillMount,
onRowWillUnmount: that.props.onRowWillUnmount
});
});

Expand Down
6 changes: 5 additions & 1 deletion modules/griddle.jsx.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ var Griddle = React.createClass({
"onRowClick": null,
"onRowMouseEnter": null,
"onRowMouseLeave": null,
"onRowWillMount": null,
"onRowWillUnmount": null,
/* css class names */
"sortAscendingClassName": "sort-ascending",
"sortDescendingClassName": "sort-descending",
Expand Down Expand Up @@ -838,7 +840,9 @@ var Griddle = React.createClass({
hasMorePages: hasMorePages,
onRowClick: this.props.onRowClick,
onRowMouseEnter: this.props.onRowMouseEnter,
onRowMouseLeave: this.props.onRowMouseLeave }));
onRowMouseLeave: this.props.onRowMouseLeave,
onRowWillMount: this.props.onRowWillMount,
onRowWillUnmount: this.props.onRowWillUnmount }));
},
getContentSection: function getContentSection(data, cols, meta, pagingContent, hasMorePages, globalData) {
if (this.shouldUseCustomGridComponent() && this.props.customGridComponent !== null) {
Expand Down
14 changes: 13 additions & 1 deletion scripts/gridRow.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,19 @@ var GridRow = React.createClass({
"onRowClick": null,
"multipleSelectionSettings": null,
"onRowMouseEnter": null,
"onRowMouseLeave": null
"onRowMouseLeave": null,
"onRowWillMount": null,
"onRowWillUnmount": null
}
},
componentWillMount: function () {
if (this.props.onRowWillMount !== null && isFunction(this.props.onRowWillMount)) {
this.props.onRowWillMount(this);
}
},
componentWillUnmount: function () {
if (this.props.onRowWillUnmount !== null && isFunction(this.props.onRowWillUnmount)) {
this.props.onRowWillUnmount(this);
}
},
handleClick: function(e){
Expand Down
6 changes: 5 additions & 1 deletion scripts/gridRowContainer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ var GridRowContainer = React.createClass({
"onRowClick": null,
"onRowMouseEnter": null,
"onRowMouseLeave": null,
"onRowWillMount": null,
"onRowWillUnmount": null,
"multipleSelectionSettings": null
};
},
Expand Down Expand Up @@ -78,7 +80,9 @@ var GridRowContainer = React.createClass({
onRowClick={that.props.onRowClick}
onRowMouseEnter={that.props.onRowMouseEnter}
onRowMouseLeave={that.props.onRowMouseLeave}
multipleSelectionSettings={this.props.multipleSelectionSettings} />
multipleSelectionSettings={this.props.multipleSelectionSettings}
onRowWillMount={that.props.onRowWillMount}
onRowWillUnmount={that.props.onRowWillUnmount} />
);

var children = null;
Expand Down
6 changes: 5 additions & 1 deletion scripts/gridTable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ var GridTable = React.createClass({
"externalIsLoading": false,
"onRowClick": null,
"onRowMouseEnter": null,
"onRowMouseLeave": null
"onRowMouseLeave": null,
"onRowWillMount": null,
"onRowWillUnmount": null
}
},
getInitialState: function(){
Expand Down Expand Up @@ -161,6 +163,8 @@ var GridTable = React.createClass({
onRowClick={that.props.onRowClick}
onRowMouseEnter={that.props.onRowMouseEnter}
onRowMouseLeave={that.props.onRowMouseLeave}
onRowWillMount={that.props.onRowWillMount}
onRowWillUnmount={that.props.onRowWillUnmount}
/>
)
});
Expand Down
6 changes: 5 additions & 1 deletion scripts/griddle.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ var Griddle = React.createClass({
"onRowClick": null,
"onRowMouseEnter": null,
"onRowMouseLeave": null,
"onRowWillMount": null,
"onRowWillUnmount": null,
/* css class names */
"sortAscendingClassName": "sort-ascending",
"sortDescendingClassName": "sort-descending",
Expand Down Expand Up @@ -869,7 +871,9 @@ var Griddle = React.createClass({
hasMorePages={hasMorePages}
onRowClick={this.props.onRowClick}
onRowMouseEnter={this.props.onRowMouseEnter}
onRowMouseLeave={this.props.onRowMouseLeave}/></div>)
onRowMouseLeave={this.props.onRowMouseLeave}
onRowWillMount={this.props.onRowWillMount}
onRowWillUnmount={this.props.onRowWillUnmount}/></div>)
},
getContentSection: function(data, cols, meta, pagingContent, hasMorePages, globalData){
if(this.shouldUseCustomGridComponent() && this.props.customGridComponent !== null){
Expand Down

0 comments on commit fff0495

Please sign in to comment.