Buccaneer
Buccaneer

Reputation: 141

Angular UI-grid options

Currently I have a grid that has a option to click and show the grid options on the far right side. The issue I'm having and I am wondering if there is a setting I can add for the grid options dropdown to automatically close when a user clicks off anywhere else or opens one of the column drop down options. Any ideas?

Upvotes: 2

Views: 864

Answers (1)

Xann009
Xann009

Reputation: 126

There does not appear to be a setting for this in the API. I assume you are using CellNav, which is the cause of this. The reason clicking on the grid cells or header cells doesn't close the grid menu is that cellnav is eating the click event.

If you are using CellNav, you may notice that the column menus do not close when clicking within cells, either.

You need to add a different event listener (let's go with mouseup) and programmatically close the menus.

Here is an example of how to achieve this using the gridApi and onRegisterApi grid option.

Upvotes: 2

Related Questions