ui-grid icon indicating copy to clipboard operation
ui-grid copied to clipboard

enableColumnResizing creates unexpected ui-grid-column-resize div when filtering or hide column

Open KaidenAlenko2017 opened this issue 7 years ago • 4 comments

I am currently following the example in API/uiGridColumnResizer

The original code of the script.js is like this

`var app = angular.module('app', ['ui.grid', 'ui.grid.resizeColumns']);

app.controller('MainCtrl', ['$scope', function ($scope) { $scope.gridOpts = { enableColumnResizing: true, data: [ { "name": "Ethel Price", "gender": "female", "company": "Enersol" }, { "name": "Claudine Neal", "gender": "female", "company": "Sealoud" }, { "name": "Beryl Rice", "gender": "female", "company": "Velity" }, { "name": "Wilder Gonzales", "gender": "male", "company": "Geekko" } ] }; }]);`

After I added these two features to the controller app.controller('MainCtrl', ['$scope', function ($scope) { $scope.gridOpts = { enableColumnResizing: true, enableGridMenu:true, enableFiltering:true, data: [ { "name": "Ethel Price", "gender": "female", "company": "Enersol" }, { "name": "Claudine Neal", "gender": "female", "company": "Sealoud" }, { "name": "Beryl Rice", "gender": "female", "company": "Velity" }, { "name": "Wilder Gonzales", "gender": "male", "company": "Geekko" } ] }; }]);`

This is the plunker that can reproduce the issue http://plnkr.co/edit/hZK2TwsMNqE5XvDQGVTN When hiding the 1st and 2nd column, or filtering, the grid unexpectedly creates a line, which is the div.ui-grid-column-resize next to the gridmenu, but is useless

How can I solve this problem? image

KaidenAlenko2017 avatar Feb 14 '18 08:02 KaidenAlenko2017

Can you give me a new link for plunker, the current one doesn't appear to work

mportuga avatar Feb 27 '18 16:02 mportuga

@mportuga I modified the link now, please check

KaidenAlenko2017 avatar Feb 28 '18 05:02 KaidenAlenko2017

Alright, I have been doing some analysis tonight and I found out that the reason for this issue is because when the notifyDataChange event fires after the hide column logic is triggered, the column resizer receives the event too early, so it adds an extra set of resizer for it which never gets removed once the column is hidden. I am still trying to figure out how to solve the issue however.

mportuga avatar Mar 28 '18 05:03 mportuga

I am too facing the same issue, any updates on this issue? @mportuga are you going to fix this issue in nearby future?

09abhishek avatar May 29 '20 05:05 09abhishek