Skip to content

Commit

Permalink
Merge pull request #71 from jrsquared/remove-deprecated-getdomnode
Browse files Browse the repository at this point in the history
Remove deprecated .getDOMNode() calls
  • Loading branch information
AllenFang committed Oct 22, 2015
2 parents 7668ae9 + b251891 commit 37b5c7e
Show file tree
Hide file tree
Showing 10 changed files with 15,751 additions and 16,373 deletions.
16,045 changes: 7,867 additions & 8,178 deletions demo/js/demo.bundle.js

Large diffs are not rendered by default.

16,043 changes: 7,866 additions & 8,177 deletions dist/react-bootstrap-table.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions lib/TableEditColumn.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ var TableEditColumn = (function (_React$Component) {
var valid = ts.props.editable.validator(value);
if (valid !== true) {
ts.refs.notifier.notice("error", valid, "Pressed ESC can cancel");
var input = ts.refs.inputRef.getDOMNode();
var input = ts.refs.inputRef;
//animate input
ts.clearTimeout();
ts.setState({ shakeEditor: true });
Expand Down Expand Up @@ -101,7 +101,7 @@ var TableEditColumn = (function (_React$Component) {
},
componentDidMount: {
value: function componentDidMount() {
var input = this.refs.inputRef.getDOMNode();
var input = this.refs.inputRef;
// input.value = this.props.children||'';
input.focus();
}
Expand Down
4 changes: 2 additions & 2 deletions lib/TableHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ var TableHeader = (function (_React$Component) {
_createClass(TableHeader, {
clearSortCaret: {
value: function clearSortCaret(order, sortField) {
var row = this.refs.header.getDOMNode();
var row = this.refs.header;
for (var i = 0; i < row.childElementCount; i++) {
var column = row.childNodes[i].childNodes[0];
if (column.getElementsByClassName("order").length > 0) {
Expand All @@ -47,7 +47,7 @@ var TableHeader = (function (_React$Component) {
//default sorting
if (this.props.sortName) {
this.clearSortCaret(this.props.sortOrder, this.props.sortName);
var row = this.refs.header.getDOMNode();
var row = this.refs.header;
for (var i = 0; i < row.childElementCount; i++) {
var column = row.childNodes[i].childNodes[0];
if (column.getAttribute("data-field") === this.props.sortName) {
Expand Down
4 changes: 2 additions & 2 deletions lib/TableHeaderColumn.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ var TableHeaderColumn = (function (_React$Component) {
value: function handleColumnClick(e) {
if (!this.props.dataSort) {
return;
}var dom = this.refs.innerDiv.getDOMNode();
}var dom = this.refs.innerDiv;
this.order = this.order == Const.SORT_DESC ? Const.SORT_ASC : Const.SORT_DESC;
this.props.clearSortCaret(this.order, this.props.dataField);
dom.appendChild(Util.renderSortCaret(this.order));
}
},
componentDidMount: {
value: function componentDidMount() {
this.refs.innerDiv.getDOMNode().setAttribute("data-field", this.props.dataField);
this.refs.innerDiv.setAttribute("data-field", this.props.dataField);
}
},
render: {
Expand Down
6 changes: 3 additions & 3 deletions lib/toolbar/ToolBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ var ToolBar = (function (_React$Component) {
//when you want same auto generate value and not allow edit, example ID field
tempValue = typeof column.autoValue == "function" ? column.autoValue() : "autovalue-" + new Date().getTime();
} else {
var dom = this.refs[column.field + i].getDOMNode();
var dom = this.refs[column.field + i];
tempValue = dom.value;

if (column.editable && column.editable.type == "checkbox") {
Expand Down Expand Up @@ -134,7 +134,7 @@ var ToolBar = (function (_React$Component) {
shakeEditor: false
});
//reset form
this.refs.form.getDOMNode().reset();
this.refs.form.reset();
}
}
},
Expand All @@ -145,7 +145,7 @@ var ToolBar = (function (_React$Component) {
},
handleCloseBtn: {
value: function handleCloseBtn(e) {
this.refs.warning.getDOMNode().style.display = "none";
this.refs.warning.style.display = "none";
}
},
handleKeyUp: {
Expand Down
4 changes: 2 additions & 2 deletions src/TableEditColumn.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class TableEditColumn extends React.Component{
var valid=ts.props.editable.validator(value);
if(valid!==true){
ts.refs.notifier.notice('error',valid,"Pressed ESC can cancel");
var input = ts.refs.inputRef.getDOMNode();
var input = ts.refs.inputRef;
//animate input
ts.clearTimeout();
ts.setState({shakeEditor:true});
Expand All @@ -65,7 +65,7 @@ class TableEditColumn extends React.Component{
}
}
componentDidMount(){
var input = this.refs.inputRef.getDOMNode();
var input = this.refs.inputRef;
// input.value = this.props.children||'';
input.focus();
}
Expand Down
4 changes: 2 additions & 2 deletions src/TableHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class TableHeader extends React.Component{
}

clearSortCaret(order, sortField){
var row = this.refs.header.getDOMNode();
var row = this.refs.header;
for(var i=0;i<row.childElementCount;i++){
var column = row.childNodes[i].childNodes[0];
if(column.getElementsByClassName("order").length > 0){
Expand All @@ -25,7 +25,7 @@ class TableHeader extends React.Component{
//default sorting
if(this.props.sortName){
this.clearSortCaret(this.props.sortOrder, this.props.sortName);
var row = this.refs.header.getDOMNode();
var row = this.refs.header;
for(var i=0;i<row.childElementCount;i++){
var column = row.childNodes[i].childNodes[0];
if(column.getAttribute('data-field') === this.props.sortName){
Expand Down
4 changes: 2 additions & 2 deletions src/TableHeaderColumn.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ class TableHeaderColumn extends React.Component{

handleColumnClick(e){
if(!this.props.dataSort)return;
var dom = this.refs.innerDiv.getDOMNode();
var dom = this.refs.innerDiv;
this.order = this.order == Const.SORT_DESC?Const.SORT_ASC:Const.SORT_DESC;
this.props.clearSortCaret(this.order, this.props.dataField);
dom.appendChild(Util.renderSortCaret(this.order));
}

componentDidMount(){
this.refs.innerDiv.getDOMNode().setAttribute("data-field", this.props.dataField);
this.refs.innerDiv.setAttribute("data-field", this.props.dataField);
}

render(){
Expand Down
6 changes: 3 additions & 3 deletions src/toolbar/ToolBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class ToolBar extends React.Component{
if(column.autoValue){//when you want same auto generate value and not allow edit, example ID field
tempValue=typeof column.autoValue=='function'?column.autoValue():('autovalue-'+new Date().getTime());
}else{
let dom = this.refs[column.field+i].getDOMNode();
let dom = this.refs[column.field+i];
tempValue = dom.value;

if(column.editable && column.editable.type == 'checkbox'){
Expand Down Expand Up @@ -86,7 +86,7 @@ class ToolBar extends React.Component{
shakeEditor:false
});
//reset form
this.refs.form.getDOMNode().reset();
this.refs.form.reset();

}
}
Expand All @@ -96,7 +96,7 @@ class ToolBar extends React.Component{
}

handleCloseBtn(e){
this.refs.warning.getDOMNode().style.display = "none";
this.refs.warning.style.display = "none";
}

handleKeyUp(e){
Expand Down

0 comments on commit 37b5c7e

Please sign in to comment.