ag-grid-react

How to keep the cell highlighted while editing

守給你的承諾、 提交于 2020-06-29 04:05:17
问题 I have a developed a custom drop-down renderer and drop-down cell editor. When the cell is highlighted by single clicking, the following css is applied to get the effect as shown in picture .ag-cell:focus { border-radius: 5px; border: 2px solid blue !important; } I would like to have the same css on the cell when it is being edited by double clicking the cell. At present, the cell highlighting is missing as shown in the below image 来源: https://stackoverflow.com/questions/61821748/how-to-keep

How to keep the cell highlighted while editing

喜你入骨 提交于 2020-06-29 04:04:15
问题 I have a developed a custom drop-down renderer and drop-down cell editor. When the cell is highlighted by single clicking, the following css is applied to get the effect as shown in picture .ag-cell:focus { border-radius: 5px; border: 2px solid blue !important; } I would like to have the same css on the cell when it is being edited by double clicking the cell. At present, the cell highlighting is missing as shown in the below image 来源: https://stackoverflow.com/questions/61821748/how-to-keep

React and Ag-Grid: populating selectcelleditor through fetch gives 'state' of undefined

时光怂恿深爱的人放手 提交于 2020-06-23 11:54:06
问题 I'm using AG-Grid to build an react application to display data from an api like a spreadsheet. Getting the data and showing it works fine, know I want to edit the data, or change the value with a predefined list, which is also fetched through an api. This is where I'm stuck since yesterday and I can't figure it out. Here is some example code: import React, { Component } from 'react'; import { AgGridReact } from 'ag-grid-react'; class AgGridExample extends Component { constructor(props) {

React and Ag-Grid: populating selectcelleditor through fetch gives 'state' of undefined

怎甘沉沦 提交于 2020-06-23 11:52:05
问题 I'm using AG-Grid to build an react application to display data from an api like a spreadsheet. Getting the data and showing it works fine, know I want to edit the data, or change the value with a predefined list, which is also fetched through an api. This is where I'm stuck since yesterday and I can't figure it out. Here is some example code: import React, { Component } from 'react'; import { AgGridReact } from 'ag-grid-react'; class AgGridExample extends Component { constructor(props) {

How can I center the text in the headers for an AG-grid control?

岁酱吖の 提交于 2020-05-25 13:12:53
问题 How can I center the text in the headers for an AG-grid control? I have tried using cellstyle and cellclass in the column definition but that did not work. Thank you 回答1: I'm using react and I just added the following snippet to my Table component's .css .ag-header-cell-label { justify-content: center; } I'm overriding the .css class class from ag-grid which I found via devtools inspection, and discovered it's using flexbox for display. See example (not react but same concept): https://embed

Using withStyles with ag-grid custom cellEditor throws warning in console - Framework component is missing the method getValue()

爷,独闯天下 提交于 2020-05-17 05:55:28
问题 I am trying to implement custom datepicker as cellEditor to ag-grid column of type date. When I use plain class component it works fine. But the moment I wrap it within a HoC, specifically withStyles of Material-ui, I receive a warning in console "Framework component is missing the method getValue()". I tried to follow the same sample (without required change for datepicker) given in this link -https://www.ag-grid.com/react-hooks/. But it doesn't work as well. And I receive the same warning

How to launch a method after a cell value has been edited in ag-grid?

主宰稳场 提交于 2020-05-15 10:19:25
问题 I have this simple column: Here's its definition: { headerName: "Activité", field: "activite", editable: true, , cellClass: "cell-wrap-text" } Here's the method I want to launch every time the user enters a new input in that column. public UpdateActValue() { this.data.sendActToBia(this.params.data.activite); } Here are my questions: 1/ Are there any ag-grid "native" way to launch a particular method after a cell value from a column has been edited? 2/ Should I simply define a custom cell

Dynamically adding and deleting row in empty ag-grid,first time row is getting deleted, second time throwing error

扶醉桌前 提交于 2020-03-25 13:57:29
问题 Initially i am displaying empty grid with header names. on click of add button new empty row should be added with delete icon.I am able to dynamically add row ag-grid.First time if i delete row after adding, its getting deleted, but second time its giving me below error.. Second time, its giving me error. Uncaught TypeError: Cannot read property 'data' of undefined Method getting calling on adding row:- createNewRowData() { let newData = { tableName: '', schemaName: '', columnName: '',

Updating 'autoGroupColumnDef' object doesn't update the table

萝らか妹 提交于 2020-01-25 12:45:06
问题 I'm passing a state object in 'autoGroupColumnDef' property of ag grid. On a switch, I need to update it's value. Using setState is not helping in this case. let temp = {...this.state.autoGroupColumnDef} temp.field = "sport" this.setState({ autoGroupColumnDef : temp }) <AgGridReact columnDefs={this.state.columnDefs} defaultColDef={this.state.defaultColDef} animateRows={true} enableRangeSelection={true} rowData={this.state.rowData} autoGroupColumnDef={this.state.autoGroupColumnDef} onGridReady

Ag-Grid : How to get the focused cell value

孤街醉人 提交于 2020-01-14 09:19:05
问题 How to get the focused cell value at the time focussing on the cell by using the keyboard arrow keys 回答1: You can either get the focused cell by using var focusedCell = gridOptions.api.getFocusedCell(); or use the onCellFocused event. Both give you the following properties: rowIndex: number column: Column Use the row-index to retrieve the row-node: var row = gridOptions.api.getDisplayedRowAtIndex(rowIndex); After that you can use those properties to retrieve the raw value of the cell: var