ag-grid

AG Grid: Better way for validation row - valueSetter?

瘦欲@ 提交于 2019-11-29 12:55:11
Is there a better way to validate a row in ag-grid than with valueSetter ? I can achieve the validation with that but I am not sure, if there is a better way. https://www.ag-grid.com/javascript-grid-value-setters/#properties-for-setters-and-parsers I want to validate two fields in the row. DateFrom and DateUntil (they are not allow to be null and DateFrom must be lower than DateUntil). There are two ways of possible validation handling: First: via ValueSetter function and Second: via custom cellEditor component I suggest that it would be better to split the logic between custom components ,

Angular Grid ag-grid columnDefs Dynamically change

Deadly 提交于 2019-11-29 05:53:27
I have a problem about columnDefs change dynamically. Here is my gridOptions: $scope.gridOptions = { columnDefs: [], enableFilter: true, rowData: null, rowSelection: 'multiple', rowDeselection: true }; and when I retrive data from server: $scope.customColumns = []; $http.post('/Home/GetProducts', { tableName: 'TABLE_PRODUCT' }).success(function (data) { angular.forEach(data.Columns, function (c) { $scope.customColumns.push( { headerName: c.Name, field: c.Value, width: c.Width } ); }); $scope.gridOptions.columnDefs = $scope.customColumns; $scope.gridOptions.rowData = data.Products; $scope

how to wordwrap a header in ag-grid

我们两清 提交于 2019-11-29 03:22:33
Using ag-grid, is there a way to split a long header across 2 rows... A break in the columnDefs headerName: 'Long<br />Header' gets me part way there (using dev tools I can see the text has the br), however one of the surrounding elements has a height of 25px; <div class="ag-header" style="height: 25px;"> which I think causes the second line of the header to not be displayed. I wondered about using group headers as an interim to get the text split, but longer term (when I need to group) that won't be an option... Try to add the following to your CSS: .ag-header-cell-label { text-overflow: clip

agSelectCellEditor dynamic list

孤人 提交于 2019-11-28 12:11:12
问题 I am using ag-grid and for any given row I would like the dropdown in one column to be dependent on the value of a different column. Can I do that with agSelectCellEditor or do I have to create a custom component. 回答1: You can define your cellEditorParams function in a way that returns different values depending on values of another column. Here is a sample from the ag-grid site - cellEditor : 'agSelectCellEditor'; cellEditorParams: function(params) { var selectedCountry = params.data.country

How to make sorting key insensitive in ag-grid?

ε祈祈猫儿з 提交于 2019-11-28 10:21:15
问题 I am working in some grids and I notice that the sorting on all of them is key sensitive is there any way to change that. This is a part of my code. columnDefs = [ { headerName: 'Id', field: 'id', sort: 'asc', sortable: true, filter: true, checkboxSelection: true, resizable: true, }, { headerName: 'Name', field: 'name', sortable: true, filter: true, checkboxSelection: false, editable: true, resizable: true, }, { headerName: 'Description', field: 'description', sortable: true, filter: true,

Repopulate ag-grid with data

ぃ、小莉子 提交于 2019-11-28 01:45:56
I am initialising the ag-grid from the html using an onGridReady method in the component file. <div style="flex-grow:1;"> <ag-grid-angular style="float:left;width: 100%; height: 201px;margin-top:10px;" class="ag-theme-balham" [gridOptions]="gridOptions" [columnDefs]="columnDefs" (gridReady)="onGridReady($event)" [rowData]="rowData" #grid > </ag-grid-angular> </div> In my .ts file i am handling the onGridReady like below : onGridReady(params?: any) { console.log("onGridReady"); var datasource = { getRows: (params: IGetRowsParams) => { this.info = "Getting datasource rows, start: " + params

how to wordwrap a header in ag-grid

旧城冷巷雨未停 提交于 2019-11-27 17:30:53
问题 Using ag-grid, is there a way to split a long header across 2 rows... A break in the columnDefs headerName: 'Long<br />Header' gets me part way there (using dev tools I can see the text has the br), however one of the surrounding elements has a height of 25px; <div class="ag-header" style="height: 25px;"> which I think causes the second line of the header to not be displayed. I wondered about using group headers as an interim to get the text split, but longer term (when I need to group) that

Angular Ag-Grid: Undo selected row changes on button click

柔情痞子 提交于 2019-11-27 09:39:11
Application built on Angular and Javascript. AG-Grid editable records having 1st column as Checkbox. After making any changes say on 5 records, after selecting checkbox for any particular record, on click of button Say <button name="Undo Changes" (click) = "undoFn()/>" Need to undo the changes made, and reload the previous data for that particular records(row) only, not the entire grid. Button is not inline with all records like a seperate column. There is only 1 button that too outside the Grid Once again in short- Need To refresh only particular row whose checkbox has been checked, on click

Grid Styling - Overwrite style of ag-grid

穿精又带淫゛_ 提交于 2019-11-26 22:09:48
问题 I have the following style: .ag-theme-fresh .ag-row-selected { background-color: #bde2e5; }` It comes from a css style file of a theme. But I want to overwrite it with this style: .ag-theme-fresh .ag-row-even .ag-row-selected { background-color: #1428df; } But it has not effect and my component uses the first style. How can I overwrite the first style 1? I tried with !important but it does nothing. Should I define my custom style at the beginning of the css file? UPDATE: I found I can use the

Angular Ag-Grid: Undo selected row changes on button click

拜拜、爱过 提交于 2019-11-26 14:48:13
问题 Application built on Angular and Javascript. AG-Grid editable records having 1st column as Checkbox. After making any changes say on 5 records, after selecting checkbox for any particular record, on click of button Say <button name="Undo Changes" (click) = "undoFn()/>" Need to undo the changes made, and reload the previous data for that particular records(row) only, not the entire grid. Button is not inline with all records like a seperate column. There is only 1 button that too outside the