Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

Custom Button on Gadget

Vote:
 

Hi,

I'm trying to add a button onto the bottom left hand side onto a custom gadget I have developed, this is where the action buttons are placed.

It's using a dojo class to do ajax call an mvc controller that send back a partial view. I've been looking at adding it through the postCreate function, but that is not working. 

I'm looking for a consistent look to other widgets in the content side bar.

Thanks

publish button

#123031
Jun 23, 2015 11:09
Vote:
 

link to image here

http://imgur.com/OHKbiJ8

#123032
Jun 23, 2015 11:11
Vote:
 

You need to implement the command pattern. Some information can be found here: http://world.episerver.com/documentation/Items/Developers-Guide/EPiServer-CMS/8/User-interface/Command-Pattern/Command-pattern/

Your widget then needs to create an instance of that command and implement the epi/shell/command/_WidgetCommandProviderMixin. If you add the command to the commands property of the provider during startup then it will automatically be discovered and added to the UI.

We have an example component on GitHub that you can get inspiration from: https://github.com/episerver/AddOn.Favorites/blob/master/ClientResources/addon/component/Favorites.js

#123043
Jun 23, 2015 13:32
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.