Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Setting titleStyle on a ButtonItem in component XML

    SmartClient_v110p_2017-03-25_Pro

    Hi,

    I want to set the style of the text in a ButtonItem using component XML. I have tried the following, but it hasn't worked:
    Code:
    <DynamicForm width="300">
        <fields>
            <field title="Click Me" type="button" titleStyle="cellopened"/>
        </fields>
    </DynamicForm>
    If I set baseStyle or cellStyle in this example then I get the expected result, but not titleStyle. How can I make this work?

    Andrew

    #2
    ButtonItem is a FormItem, so when you set titleStyle you are setting formItem.titleStyle, which would affect the styling of a title shown externally to the button in an adjacent cell in the form layout. Showing this separate title is off by default for ButtonItem.

    There is a stretchImgButton.titleStyle attribute, which could be set via ButtonItem.buttonProperties *if* you know that a StretchImgButton is being used as the default button type in the current skin. But it's not the default in any of the recent skins, since StretchImgButton uses images and this isn't necessary anymore (we use CSS3 to create a similar look now).

    Most likely, you don't actually want to use titleStyle at all, and you just want to take the existing baseStyle in use for the button and define a new style series with whatever change you were trying to make, then apply that via baseStyle.

    Comment

    Working...
    X