Skip to content

Commit

Permalink
Fixed #734 - DataTable edit throws error on route change
Browse files Browse the repository at this point in the history
  • Loading branch information
cagataycivici committed Jan 9, 2019
1 parent 27af3ed commit 6a49274
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/components/datatable/BodyCell.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ export class BodyCell extends Component {
}
}

componentWillUnmount() {
this.unbindDocumentEditListener();
}

render() {
let content, header;
let cellClassName = classNames(this.props.bodyClassName||this.props.className, {
Expand Down
6 changes: 6 additions & 0 deletions src/sass/App.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1184,6 +1184,12 @@ pre[class*="language-"] {
padding-top: 0 !important;
}

.treetableedit-demo {
.p-treetable tr {
outline: 0 none;
}
}

/* FlexGrid Demos */
.flexgrid-demo {
.box,
Expand Down
4 changes: 2 additions & 2 deletions src/showcase/treetable/TreeTableEditDemo.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,14 @@ export class TreeTableEditDemo extends Component {
<div>
<TreeTableSubmenu />

<div className="content-section introduction">
<div className="content-section introduction treetableeditdemo">
<div className="feature-intro">
<h1>TreeTable - Edit</h1>
<p>Incell editing provides a quick and user friendly way to manipulate data.</p>
</div>
</div>

<div className="content-section implementation">
<div className="content-section implementation treetableedit-demo">
<TreeTable value={this.state.nodes}>
<Column field="name" header="Name" expander style={{height: '3.5em'}}></Column>
<Column field="size" header="Size" editor={this.sizeEditor} editorValidator={this.requiredValidator} style={{height: '3.5em'}}></Column>
Expand Down

0 comments on commit 6a49274

Please sign in to comment.