Skip to main content

ASPxClientFloatingActionButton.GetAction(contextName) Method

Gets the action or action group by its context name.

Declaration

GetAction(
    contextName: string
): ASPxClientFABAction

Parameters

Name Type Description
contextName string

An action’s (action group’s) context name.

Returns

Type Description
ASPxClientFABAction

An action (action group).

Remarks

Web Forms:

<dx:ASPxFloatingActionButton ID="ASPxFloatingActionButton1" runat="server" ClientInstanceName="fab" ContainerElementID="content">
    <ClientSideEvents Init="OnInit" ActionItemClick="OnActionItemClick" />
    <Items>
        <dx:FABActionGroup ContextName="ShareItemContext" Text="Share">
            <ExpandImage Url="../Content/FloatingActionButton/Images/Share.svg"></ExpandImage>
            <Items>
                ...
                <dx:FABActionItem ActionName="GooglePlus">
                    <Image Url="../Content/FloatingActionButton/Images/GooglePlus.svg"></Image>
                </dx:FABActionItem>
                <dx:FABActionItem ActionName="Facebook">
                    <Image Url="../Content/FloatingActionButton/Images/Facebook.svg"></Image>
                </dx:FABActionItem>
            </Items>
        </dx:FABActionGroup>
        ...
    </Items>
</dx:ASPxFloatingActionButton>

MVC:

@{
    var _fabActionItemCollection = new FABActionItemCollection();
    _fabActionItemCollection.Add(new FABActionItem("Down", "icon1.png"));
    _fabActionItemCollection.Add(new FABActionItem("Up", "icon2.png"));
}
@Html.DevExpress().FloatingActionButton(floatingActionButtonSettings => {
    floatingActionButtonSettings.Name = "fab";
    floatingActionButtonSettings.ContainerElementID = "Grid";
    floatingActionButtonSettings.Items.Add(new FABAction("Action1", "Action1"));
    floatingActionButtonSettings.Items.Add(new FABActionGroup("Action2", _fabActionItemCollection));
    floatingActionButtonSettings.ClientSideEvents.ActionItemClick = "onItemClick";
...
}).GetHtml()

Concept

Floating Action Button

See Also