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

Need a way to re-assign grid menu dropdown to any button

Open rddolan opened this issue 11 years ago • 4 comments

Hello, for my company I need a way to assign the main grid menu to a separate document element. I see that the uiGridMenu requires uiGrid to be present - so I'm guessing that means they're coupled?

I tried using the header template to customize the menu but the results were that the column headers became corrupted.

How much work would it be to make a grid menu with just a shared ui-grid scope instead of the hard require? Thanks

rddolan avatar Apr 06 '15 22:04 rddolan

uiGridMenuItem does require uiGrid, but it looks like uiGridMenu itself does not. It's optional.

Depending on how you want to interact with the grid it may be possible to use a third-party menu widget and pass it a reference to the grid API.

c0bra avatar Apr 07 '15 21:04 c0bra

c0bra, is there an example of how to attach functions to other elements using the grid API? Would this be possible with all of the menu item functions?

How much effort would it be to have an optional jquery selector to specify where the menu shows up? Thanks

rddolan avatar Apr 07 '15 21:04 rddolan

If it were me I'd just build the new menu. There are really only a few things that attach to the grid menu:

  • column hiding and showing. The underlying methods are available via the API, easy enough to recreate
  • import and export, again the methods are available via API to attach to a custom widget It shouldn't be overly hard to put them into a new menu.

Alternatively, you could override the ui-grid-header.html template to put the menu somewhere else, or to style it.

PaulL1 avatar Apr 07 '15 22:04 PaulL1

No further comment for over a month, solution provided that probably resolves the issue. Closing, please re-raise if there is a reliable recreate or more information.

PaulL1 avatar May 16 '15 06:05 PaulL1