def build_addon_button(text, action, title=""):
    """Builds am action button to be rendered in HGrid

    :param str text: A string or html to appear on the button itself
    :param str action: The name of the HGrid action for the button to call.
        The callback for the HGrid action must be defined as a member of HGrid.Actions
    :return dict: Hgrid formatted dictionary for custom buttons

    """
    button = {
        'text': text,
        'action': action,
    }
    if title:
        button['attributes'] = 'title="{title}" data-toggle="tooltip" data-placement="right" '.format(title=title)
    return button