Announcement

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

    Is it possible to have title on CheckboxItem be left of checkbox?

    I would like to have all title of my form be aligned. The CheckboxItem is different from others in that its title is dsiplayed to right of checkbox active area. Is there a way to override this and have the title be on the left?

    BTW, I tried using item.setTitleOrientation(TitleOrientation.LEFT) as well as item.setTitleOrientation(TitleOrientation.TOP). Both worked on other types of items but not on CheckboxItem.

    Am I doing something wrong?

    #2
    According to this thread, it is possible to do so.

    But I believe it won't work with the 1.0b2, or you need to create this method yourself:

    Code:
        /**
        * By default a checkboxItem sets {@link com.smartgwt.client.widgets.form.fields.CheckboxItem#getShowTitle showTitle}:true, and so takes up two cells with the default ${isc.DocUtils.linkForRef('type:TitleOrientation')} of "left" (see form layout overview).  However, the title cell is left blank by default, and the title specified by {@link com.smartgwt.client.widgets.form.fields.FormItem#getTitle title} is shown inside the formItem's cell instead, in an element called the "label". <P> To instead show the title in it's original location, set <code>labelAsTitle:true</code>. You can also set {@link com.smartgwt.client.widgets.form.fields.CheckboxItem#getShowLabel showLabel}:false to suppress the label and/or title altogether.
        *
        * @param labelAsTitle labelAsTitle Default value is null
        */
        public void setLabelAsTitle(Boolean labelAsTitle) {
            setAttribute("labelAsTitle", labelAsTitle);
        }
    Regards,

    -TG

    Comment


      #3
      In the meanwhile "setLabelAsTitle" has been integrated in smartgwt - no need to create it yourself anymore.

      Comment

      Working...
      X