Relative Content

Tag Archive for javascriptag-grid

Ag-grid table that fits the contents for many columns, but also fit width for few columns

I have an ag-grid (in javascript) that sometimes can have many columns, and others just a few (and they have different contets/sizes). I’d like to have an auto-size that fits at least the content (so, the columns can occupy a larger width than the grid size, with horizontal scrolling), but if there are only few columns, they’d stretch to fill the whole grid. The autoSizeStrategy type: 'fitCellContents' fit the contents, but when I have few columns, it does not occupy the whole grid. On the other hand, type: 'fitGridWidth' sometimes make the cells smaller than the contents. Is there a way to achieve both?

Ag-Grid Filter Based on User Parameters

I’m wondering if there is a way to automatically filter the data that is returned, based on parameters specified in json file. If I use the ag-grid link https://www.ag-grid.com/javascript-data-grid/component-filter/ as an example, let’s say the user has a country parameter of “Australia” and I only want them to see athletes from Australia, but this filter should automatically be applied when the user logs into the application. This would actually be role based access control, but applied to the data return by ag-grid.

¿Ag-Grid, How to update the agSelectCellEditor correctly?

I am using Ag-Grid with JS.
I have a column to list airports, the list is saved in the airport variable, if I dynamically select an airport I see it visually but if I click on the cell it adds the first value of the airport list, what is this due to?

Params.data coming null while formating column value in currency format using ag grid

I am new to AG Grid and trying to bind some data to the grid. For one of the column which shows cost, I am trying to format it in currency but my params.data is coming null. I dont know what is the correct way of getting the params so that my params will have data for that row and column. When I console params, I see a lot of properties but data and value is undefined. Below is what I am trying to do. In my third else if, I am trying to format that entire column value in currency format but params.data is coming null. Also my grand row total is not appearing even after using the property. Any help is much appreciated

How to prevent row re-ordering on cell data update using ag-grid

I have an ag-grid table where the data is updated using async transactions. I need to have two modes (toggled by button click): one where rows are automatically re-ordered when data is updated as usual, and another where after sorting by column asc/desc that order is then preserved through updates – effectively freezing rows in place.