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

Custom Header Template ONLY Works when ui-grid="options" is used in html

Open WorkMAE opened this issue 8 years ago • 3 comments

This has to be a bug because if not it is a terrible design decision. Check this fiddle out below, then change ui-grid="options" to anything else and change the appropriate other items where options is used to whatever you changed it to and it no longer works. What happens if you have multiple grids on a page that need custom headers? Only one of them could use "options" and the rest simply won't work.

https://jsfiddle.net/wexmj2Lw/228/

WorkMAE avatar Aug 03 '18 18:08 WorkMAE

I am not sure what you mean... Are you talking about changing the variable name, because that works? I am sorry, I am certain the misunderstanding is on my side, but I can't understand what you are trying to do here.

mportuga avatar Aug 04 '18 20:08 mportuga

When you declare a ui-grid in the div.

<div ui-grid="options"> works <div ui-grid="myOptions"> or any other name other than "options" does not with a custom header template

WorkMAE avatar Aug 09 '18 21:08 WorkMAE

I dont see anything breaking by changing the options variable to something else: https://jsfiddle.net/pvj8q4r5/

The "grid.options" in the template is bound to the grid instance, if you need to access any other variable in the scope have a look at grid.appScope

m4m4m4 avatar Aug 14 '18 07:08 m4m4m4