How to retrieve the column widths in AngularJS ag-grid after resizing

Can anyone tell me how to retrieve the new width of columns in AngularJS ag-grid after resizing them?

I have part of the grid configuration below:


$scope.gridOptions = {
    enableColResize: true                   
};

Thanks

Answer №2

function resizeGrid(grid) { 
  setTimeout(function() { 
    grid.$gridServices?.DomUtilityService.RebuildGrid(grid.$gridScope, grid.ngGrid);
  }, 100);
}

If you are experiencing shrinkage issues with ag-Grid in AngularJS, you can use the above function to fix it by simply passing your grid as a parameter.

Please note that this solution is tailored for AngularJS and may not work for Angular.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Execute an HTTP POST request to the Node server, sending an empty object

For my project, I am attempting to send an HTTP Post request to my Node server from an html form. Despite using Body Parser and setting it up correctly, I am facing an issue where the req.body on my server is returning as an empty object. Can anyone prov ...

AngularJS: Utilizing Multiple HTTP Requests with the $http Service

Here is the code snippet I am working with: var updateScreen = function() { $http.get("http://localhost:5000").then(function(response){ $scope.numSerie = response.data.refDetail.Num_Serie; $http.get("data/tempsgammes ...

Do not reload the page after a successful ajax request

I'm using an Ajax section to submit data in Laravel. I want the page to not reload if the submission is successful, but to reload if there's an error. Currently, when there is an error, the page reloads correctly. However, I'm facing an issu ...

Showing live JSON data in AngularJS

Receiving a JSON string from a web service, the content may differ depending on the request. Here are 2 JSON results: Result 1 [ { "Key": 1, "ID": 1, "applicationId": "1", "applicationName": "APP1" }, { "Key": 2, "ID": 1, ...

What could be causing my boolean to return as 'undefined'?

Currently, I am actively engaged in studying Eloquent Javascript and came across an intriguing exercise that requires the creation of an every function. This function is responsible for taking an array and a specified function as parameters, ultimately ret ...

I was unable to locate the element using angular.element('#id')

After implementing the following code in my Angular controller to locate my elements: var el = angular.element('#id'); I noticed that it is not functioning as expected. What could be causing this issue? Should I resort to utilizing jQuery inst ...

Javascript canvas producing a laser beam that serves no purpose

Greetings! I am diving into JavaScript and trying my hand at creating a game. The concept is simple - a ship shooting lasers at alien spacecrafts. However, I've encountered a problem with the destroy function that has left me scratching my head. Surpr ...

I am unable to utilize the map function as it results in a TypeError: The property 'map' is undefined and cannot be read

I recently delved into the world of "REACT" in order to work on the front-end of my own project. I encountered a problem for 2 days with the map function while getting data from my back-end and saving the IDs in the Cuartos array. I couldn't figure ou ...

FixPermissions not working properly | Discord.js EXPERT

I am currently in the process of updating my bot to be compatible with the latest version of discord.js. I have successfully made various changes, but I am facing an issue with the overwritePermissions section within my ticket command. For some reason, the ...

transferring photos using tinymce to the server

Upload Handler I am in the process of implementing an upload handler for Tinymce on the server-side. After extensive research, I came across an example using PHP which can be found here. However, I require a similar handler to be implemented in Node.js. ...

Populating dropdown menu with data fetched from an AJAX request

I've created a dropdown in my cshtml page: @( Html.Kendo().DropDownList().Name("ddlCode").OptionLabel("Select Code...").BindTo(@ViewBag.dropDown) .DataTextField("Title") .DataValueField("domainCode") The dropdown is bound up ...

Having difficulty inputting password for telnet login using Node.js

When I use telnet from the Windows command line, everything works smoothly: > telnet telehack.com (... wait until a '.' appears) . login username? example password? (examplepass) * * * * * * * Logged... (...) @ (This is the prompt when you ...

The first time I tried using React-app, I encountered an error that read "[email protected] postinstall"

I've been struggling to set up create-react-app, encountering the same issue repeatedly. I tried uninstalling and reinstalling node.js, but only the package.json and my-app folder were created. No src or other required folders were generated. Termina ...

When the "next" button is clicked on Datatables, the next set of 10 items

I am currently working on creating a table with pagination using datatables. The data is being fetched via ajax, which returns 10 data entries at a time. However, I am facing an issue where the first call only fetches the initial 10 data from the ajax call ...

Modifying CSS using jQuery can be achieved with the .parent().addClass method, however, using just .addClass

When I first started working on my validation using jquery/javascript, it was not very effective. However, with the implementation of a new css class and updates to my jquery validation, things have greatly improved. I've been focusing on enhancing u ...

Turn off all animations for a specific div or HTML page

Whenever I add an item to a div, there's this strange flashing animation happening. It's like a blink or flash that updates the div with new data. I'm not entirely sure if it's a jQuery animation or not. Is there any way to disable all ...

Video player on website experiencing issues with playing VAST ads

Hey there! Check out this awesome site for Music Videos: (Music Videos(Player)) I've been testing different options, but if you have a better suggestion, please let me know. Any help would be really appreciated. If I can't figure it out on my o ...

Blade fails to detect PHP when utilizing an alternative symbol for Angular

I am currently using Angular and facing an issue with changing the date format. Blade seems to be unable to recognize the PHP code that is being generated. Everything else in my code works fine except for the created_at function. <div id="mypost" c ...

I have implemented a Javascript solution for automatically inserting hyphens in phone numbers. However, I now need to enhance this code to also remove hyphens automatically, or I may need to explore alternative

I came across a helpful JavaScript code snippet in a forum that automatically hyphenates numbers. However, a small issue arose where if someone enters a 10-digit US phone number and then decides to edit it, they would have to manually delete the hyphens as ...

When it comes to adjusting the height of an element, there are two ways to go about it: using $(element).height

function adjustHeight(){ var headerHeight=$(element).find('.header').outerHeight(); console.log(headerHeight); var temp=$(window).height()-headerHeight; console.log(temp); $('.users ...