ag-grid

How can I get all the rows of ag-grid?

断了今生、忘了曾经 提交于 2020-06-25 08:57:50
问题 ag-grid provides a way to get selected rows using api.getSelectedRows() function. And provides a way to set all rows using api.setRowData([]) function. I'm looking for something getAllRows() to return all the rows in the grid. I know there is a way to loop through all the rows using api.forEachNode() etc. Is there any way I can get the entire array of rows? 回答1: I don't think there is such a method but you can make your own: getAllRows() { let rowData = []; this.gridApi.forEachNode(node =>

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) {

ng build --prod failed after ag-grid v 22.1.1 upgrade

南楼画角 提交于 2020-06-23 11:09:12
问题 I've started using ag-grid since its version 18 and currently at 20.0.0 I am in the process of upgrading to its latest version - 22.1.1. After resolving warning/errors due to breaking changes, everything - including 'ng serve' works fine. However, when I try to build angular application in prod mode, it fails. ERROR in ./app/app.module.ngfactory.js Module not found: Error: Can't resolve 'ag-grid-community/dist/lib/eventService' in 'C:\project\src\app'ERROR in ./main.ts Module not found: Error

ng build --prod failed after ag-grid v 22.1.1 upgrade

早过忘川 提交于 2020-06-23 11:09:07
问题 I've started using ag-grid since its version 18 and currently at 20.0.0 I am in the process of upgrading to its latest version - 22.1.1. After resolving warning/errors due to breaking changes, everything - including 'ng serve' works fine. However, when I try to build angular application in prod mode, it fails. ERROR in ./app/app.module.ngfactory.js Module not found: Error: Can't resolve 'ag-grid-community/dist/lib/eventService' in 'C:\project\src\app'ERROR in ./main.ts Module not found: Error

getRowHeight() not working with rowModelType = 'infinite' with latest ag-grid version

点点圈 提交于 2020-06-18 12:55:14
问题 I see this Note on ag-grid site: Changing the row height is only supported in the in memory row model. You cannot use variable row height when using virtual paging, viewport or enterprise row models. This is because these row models need to work out the position of rows that are not loaded and hence need to assume the row height is fixed. But getRowHeight() was well supported in previous releases(7.x), so was wondering there must be some alternate way to achieve that. I was using rowModelType

Change background color of every other row

一世执手 提交于 2020-06-17 09:37:07
问题 I'm trying to replicate the default settings of ag-grid which paints every other rows background in a slightly different color. But when I try to reorder columns clicking on headerColumn the background colors doesn't reorder. This is my current approach that isn´t working cellStyle(params) { let backgroundColor = #FFFFFF; if (params.node.rowIndex % 2 === 1) backgroundColor = #E04F00; } https://plnkr.co/edit/bHLEmECLNby3obIT, this example shows the desired behavior. Is there a way to acces and

Angular2 - Ag Grid - Get Parent Instance in Cell Renderer Component

匆匆过客 提交于 2020-06-16 04:41:06
问题 I am using Ag Grid for displaying a list of items in my Project. I have implemented Ag Grid with colDef for grid as like below custom.component.ts CustomComponent //colum definition array [ { headerName: "Actions", field: "action", width: 100, cellRendererFramework: ActionRendererComponent, }, ] ActionRendererComponent import {Component} from '@angular/core'; import {AgRendererComponent} from 'ag-grid-ng2/main'; @Component({ selector: 'action-cell', template: ` <a href="javascript:" *ngIf=

Ag-Grid edit data and sending to server

时光怂恿深爱的人放手 提交于 2020-06-15 18:58:25
问题 Ag-grid on angular able to create grid fetching data from local json file. On editing any row how to save that data and then send to server or possibly local json file ?? In short Ag-Grid how to save row data after edit and send to server on click of Submit button. Anyone if implemented this on Javascript please comment, will try to use that on angular Please let me know if there is any other best option apart from ag-grid to implement this functionality 回答1: If you want to listen to specific

Ag-Grid edit data and sending to server

六眼飞鱼酱① 提交于 2020-06-15 18:58:24
问题 Ag-grid on angular able to create grid fetching data from local json file. On editing any row how to save that data and then send to server or possibly local json file ?? In short Ag-Grid how to save row data after edit and send to server on click of Submit button. Anyone if implemented this on Javascript please comment, will try to use that on angular Please let me know if there is any other best option apart from ag-grid to implement this functionality 回答1: If you want to listen to specific