如何根据reactGridLayout的变化自动呈现表格宽度?

时间:2019-01-24 14:28:31

标签: javascript angularjs reactjs grid-layout ag-grid

layout image我正在使用ResponsiveReactGridLayout来调整纸张组件的大小,但是在调整大小后,我无法重新调整与布局更改宽度相同的AGGrid表的大小

我尝试使用以下代码,布局表的onchange不能完全调整大小

            <ResponsiveReactGridLayout 
               layouts={this.state.layout} 
               onLayoutChange={this.onLayoutChange}
               className={this.state.className}            
                rowHeight={this.state.rowHeight}
                cols={this.state.cols}
                initialLayout= {this.state.layout}
                initialWidth={this.state.initialWidth}
                width={this.state.width}
                verticalCompact={false}
                listenToWindowResize={false}
                currentBreakpoint= 'sm'
                >
              {this.state.response && this.state.response.data && this.state.response.data.map((data, i) => 
                <Paper id='resizer' key={i} className="paper_panel">
                    <div style={containerStyle} className="ag-blue">
                    <AgGridReact
                        columnDefs={this.createHeader()}
                        rowData={this.tableData()}
                        onGridReady={this.onGridReady}
                        enableFilter
                        enableSorting>
                    </AgGridReact>
                    </div>


                </Paper>
              )} 
            </ResponsiveReactGridLayout>



            let containerStyle = {
              height:300,
              width: 500
          };

我需要根据布局更改来调整表的大小

0 个答案:

没有答案