Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ee203d9a06 |
@@ -16,7 +16,6 @@ label {
|
|||||||
|
|
||||||
.div-percent-value {
|
.div-percent-value {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
z-index: 1;
|
|
||||||
padding-left: 4px;
|
padding-left: 4px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
|
|||||||
@@ -6,6 +6,9 @@ import RowDataFactory from './RowDataFactory';
|
|||||||
import ColDefFactory from './ColDefFactory.jsx';
|
import ColDefFactory from './ColDefFactory.jsx';
|
||||||
import './MyApp.css';
|
import './MyApp.css';
|
||||||
|
|
||||||
|
// take this line out if you do not want to use ag-Grid-Enterprise
|
||||||
|
import 'ag-grid-enterprise';
|
||||||
|
|
||||||
export default class MyApp extends React.Component {
|
export default class MyApp extends React.Component {
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
@@ -55,7 +58,7 @@ export default class MyApp extends React.Component {
|
|||||||
this.setState({showToolPanel: event.target.checked});
|
this.setState({showToolPanel: event.target.checked});
|
||||||
}
|
}
|
||||||
|
|
||||||
onReady(params) {
|
onGridReady(params) {
|
||||||
this.api = params.api;
|
this.api = params.api;
|
||||||
this.columnApi = params.columnApi;
|
this.columnApi = params.columnApi;
|
||||||
}
|
}
|
||||||
@@ -91,34 +94,6 @@ export default class MyApp extends React.Component {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
|
||||||
return (
|
|
||||||
// ag-Grid comes with a React Component waiting to be used
|
|
||||||
<AgGridReact
|
|
||||||
|
|
||||||
// listen for events with React callbacks
|
|
||||||
onRowSelected={this.onRowSelected.bind(this)}
|
|
||||||
onCellClicked={this.onCellClicked.bind(this)}
|
|
||||||
|
|
||||||
// binding to properties within React State or Props
|
|
||||||
showToolPanel={this.state.showToolPanel}
|
|
||||||
quickFilterText={this.state.quickFilterText}
|
|
||||||
icons={this.state.icons}
|
|
||||||
|
|
||||||
// column definitions and row data are immutable, the grid
|
|
||||||
// will update when these lists change
|
|
||||||
columnDefs={this.state.columnDefs}
|
|
||||||
rowData={this.state.rowData}
|
|
||||||
|
|
||||||
// or provide props the old way with no binding
|
|
||||||
rowSelection="multiple"
|
|
||||||
enableSorting="true"
|
|
||||||
enableFilter="true"
|
|
||||||
rowHeight="22"
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
var gridTemplate;
|
var gridTemplate;
|
||||||
var bottomHeaderTemplate;
|
var bottomHeaderTemplate;
|
||||||
@@ -172,7 +147,7 @@ export default class MyApp extends React.Component {
|
|||||||
gridOptions={this.gridOptions}
|
gridOptions={this.gridOptions}
|
||||||
|
|
||||||
// listening for events
|
// listening for events
|
||||||
onReady={this.onReady.bind(this)}
|
onGridReady={this.onGridReady.bind(this)}
|
||||||
onRowSelected={this.onRowSelected.bind(this)}
|
onRowSelected={this.onRowSelected.bind(this)}
|
||||||
onCellClicked={this.onCellClicked.bind(this)}
|
onCellClicked={this.onCellClicked.bind(this)}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user