Announcement

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

    #16
    That's operating as designed. A canSave=false field is rendered by default as a StaticTextItem which doesn't have a disabled state because it is never editable.

    Comment


      #17
      Originally posted by davidj6
      That's operating as designed. A canSave=false field is rendered by default as a StaticTextItem which doesn't have a disabled state because it is never editable.
      Then what settings do I use to make it appear disabled? Is it possible?

      Comment


        #18
        setDisabled() disables the item, however, since a StaticTextItem is not editable at all, by design there is no distinction between it's enabled and disabled appearance. If you don't like that styling, you can change it.

        Comment


          #19
          Originally posted by Isomorphic
          setDisabled() disables the item, however, since a StaticTextItem is not editable at all, by design there is no distinction between it's enabled and disabled appearance. If you don't like that styling, you can change it.
          I don't understand that. A StaticTextItem does have a distinction between its enabled and disabled appearance - so does all static text (for example, labels on entry fields), and a date field displayed normally. As far as I can tell, a date field displayed as a StaticTextItem is the ONLY control which doesn't have a distinction between its enabled and disabled appearance. This makes no sense to me. If it's by design, then why aren't all non-editable controls the same?

          In any case, how do I change that styling? I've tried using stylesheets and can't get it to work.

          Comment


            #20
            Not sure why you don't believe the developer, but a StaticTextItem does not have a different disabled style. This is not specific to a non-editable date. Any field defined canSave=false in the DataSource is rendered as a StaticTextItem. This is NOT the same as disabling an item later. Additionally, labels on other form items are NOT StaticTextItems.

            Search the skin .css file for staticTextItem for details on the styles being applied.

            Comment


              #21
              This can be accomplished by overriding the SmartGWT staticTextItemDisabled css class in your own CSS file. Use the !important declaration to make yours take precedence over the SmartGWT one.

              Code:
              .staticTextItemDisabled {
              	color: #AAAAAA !important;
              }

              Comment

              Working...
              X