1 | import React, { Component } from "react";
|
2 | import BeeGrid, { GridToolBar } from "bee-complex-grid";
|
3 | import { gridDefalutProps,paginationDefaultProps } from './defaultProps'
|
4 |
|
5 |
|
6 | const defaultProps = {
|
7 | headerScroll: false,
|
8 | bordered: false,
|
9 | data: [],
|
10 | columnFilterAble:false,
|
11 | ...gridDefalutProps
|
12 | };
|
13 |
|
14 | class Grid extends Component{
|
15 |
|
16 | exportExcel=()=>{
|
17 | this.grid.exportExcel();
|
18 | }
|
19 | render(){
|
20 | const { paginationObj, data,exportData,headerScroll, ...otherProps } = this.props;
|
21 | let _paginationObj ='none';
|
22 | if(paginationObj!='none'){
|
23 | _paginationObj = {...paginationDefaultProps,...paginationObj}
|
24 | }
|
25 | return <div className={`ac-gridcn ${headerScroll?'header-scroll':''}`}>
|
26 | <BeeGrid
|
27 | {...otherProps}
|
28 | headerScroll={headerScroll}
|
29 | data={data}
|
30 | paginationObj={_paginationObj}
|
31 | ref={ref=>this.grid=ref}
|
32 | exportData={exportData||data}
|
33 | />
|
34 | </div>
|
35 | }
|
36 | }
|
37 |
|
38 | Grid.defaultProps = defaultProps;
|
39 | Grid.GridToolBar = GridToolBar;
|
40 |
|
41 | export default Grid; |
\ | No newline at end of file |