Possible bug in grid menu when enableFiltering: true?
I'm trying to upgrade from ui-grid 3.0.1 to latest stable (currently 3.0.7), but I'm seeing this strange behavior of the grid menu in all versions greater than 3.0.1:
See this plunker: http://plnkr.co/edit/UQ6Jeh6acfEGZliKgsI8?p=preview
- First, open the grid menu, then scroll down a bit and toggle one of the columns. You'll notice it automatically scrolls you to the top of the list again, making it more difficult to toggle other columns.
- Second, open app.js and change enableFiltering to false. Refresh and try toggling columns in the grid menu again. It maintains the scroll position, making it easier to toggle the rest of the columns quickly.
This was never the case with 3.0.1. Does anyone know how I can get the latest builds to play nicely with this filtering enabled?
Let me just rephrase it for any willing contributor: if gridOptions.enableFiltering is true, then the grid menu always scrolls to the top after any column modification.
I'm having the same issue:
https://github.com/angular-ui/ui-grid/issues/4921
I tried event.preventDefaults all over the place and returning false to no avail - it's not an A tag, so i'm not sure where the scroll action is coming from.
We have the same issue in our application. Are there any update or workaround here?
I encountered the same.
On Chrome (latest version) the grid menu here (and in my apps) http://ui-grid.info/docs/#/tutorial/121_grid_menu behaves strange : If you click on a column visibility item (to show or hide a column), the first menu item gets the focus. If there are many columns and a vertical scrollbar is shown, the view is scrolled to the top of items.It is impossible to click multiple items without scrolling.
It does not happen in FF and IE in my tests.
Not sure, but this code in function itemAction is responsible:
/* * XXX: Fix after column refactor * Ideally the focus would remain on the item. * However, since there are two menu items that have their 'show' property toggled instead. This is a quick fix. */ gridUtil.focus.bySelector(angular.element(gridUtil.closestElm($elm, ".ui-grid-menu-items")), 'button[type=button]', true);
It looks to me as if this code puts the focus on the first button item in the menu items list.
I suggest the following fix
gridUtil.focus.byElement(angular.element($event.target));
target is supported by all browsers.
Unfortunately, I cannot provide a plunk since the compilated grid file is to large to be added as a file. (It returns bad gateway if doing so)
Hi, @ChrisWiGit thanks for the input.
My team is facing the exact same issue. Can you please open a pull request to get your solution merged? Thanks a lot.
Thank you @ChrisWiGit !! I've been using your fix for a few days and it seems to work without any issues. Hopefully this is merged into future releases.
@ChrisWiGit : Thanks for the fix you provided. It's working like a charm.
Thank you @ChrisWiGit !!
I'm also having same issue only when I set my gridoption.enableFiltering to true. And I'm using your fix and it seems to work perfectly. Hopefully this will be merged into future releases. Thank you very much !!!!
I'm having the same issue, when I use enableFiltering: true, the filters do not appear in the grid, possibly the first row is overriding the filters as I can see the content in the source (developer tools). enableFiltering: true, enableRowSelection: true, multiSelect: false, paginationPageSizes: [50, 100, 150, 200], paginationPageSize: 50, Also, when I click on the menu on each column, the menu appears from the 2nd row, which is giving a confirmation that there is something wrong and filters row is actually being overwritten by the first row of the data.
Importantly, when I use ui-grid-selection for the grid, the header (Columns and Filters) doesn't show up. If the same is removed, header comes up fine.
I'm using: ui-grid - v3.1.1 - 2016-02-09
But the plunker sample is working fine. Any help is appreciated?
Hi @ChrisWiGit , i have applied your solution to my project and it has been working fine so far. In addition, i also added ui-grid.min.js file this code " ;if(!b.leaveOpen){b.$emit("hide-menu");}}}, " instead of " ,b.leaveOpen?a.focus.bySelector(angular.element(a.closestElm(d,".ui-grid-menu-items")),"button[type=button]",!0):b.$emit("hide-menu")}}, " .
same problem, mark
Thanks for your fix @ChrisWiGit, it works fine with ui-grid#3.2.1. Hope this fix will be merged into next release.
I have Same Issue but i don't understand to how to solve it If the table is half way down the page, when I click on the icon which allows me to control the columns that are displayed, the menu opens, but it's forcing the page to scroll to the top.
When I have a bunch of columns and the menu itself scrolls, when I click on an individual option in the menu, it forces the menu to scroll to the top as well. please help me http://ui-grid.info/docs/#/tutorial/405_exporting_all_data_complex this above link is working fine but the bellow link has poblem http://ui-grid.info/docs/#/tutorial/401_AllFeatures
please help me to
@pawanupr16 I'm using v3.2.9 and facing the same issue as you have.
Any solution for this? Is it fixed in official release?