is it possible to pass arguments to the 'umbButtonGroup' handler function?
hey out there,
i want to use the umbButtonGroup directive inside a ng-repeat so each row can have multiple actions in one button rather than having a bunch of buttons.
trick is, i need to pass the item to the handler function:
defaultButton: {
labelKey: "general_defaultButton",
hotKey: "ctrl+d",
hotKeyWhenHidden: true,
handler: function() {
// do magic here
}
}
does anyone know if this is possible? i've attempted a couple of different things and picked through the core code but can't find an example where this happens...
is it possible to pass arguments to the 'umbButtonGroup' handler function?
hey out there,
i want to use the
umbButtonGroup
directive inside ang-repeat
so each row can have multiple actions in one button rather than having a bunch of buttons.https://our.umbraco.com/apidocs/v8/ui/#/api/umbraco.directives.directive:umbButtonGroup
trick is, i need to pass the item to the
handler
function:does anyone know if this is possible? i've attempted a couple of different things and picked through the core code but can't find an example where this happens...
any suggestions would be grand!
cheers,
jake
i came to the conclusion that the core directive just didn't support what i was trying to do so i ended up making my own ;)
it's 99.9% the same as the one in the core but allows you to pass an argument variable.
this is the view - i've named it
umb-button-group-extended.html
:and this is the js:
it can be used in the views as:
and wired up with the following js:
passing an object or property to the
args
property on the scope will pass it up to the handlers for the default and sub buttons.hope someone out there finds this useful ;)
Hey Jake , In the umbraco updation these changes also will replace with the core files right??
hey there,
no, this doesn't replace the one in the umbraco core...
i'm using this in a package so it's loaded as an additional directive...
i may try and push it in as a change request to the core though as it's a useful tweak!
cheers,
jake
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.