Announcement

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

    Class.setProperty

    Not sure if this is a bug or intended behaviour but I am trying to dynamically change my image button's style like below onClick - It seems that it doesn't like my empty value. In the second example, if I give an actual value, it works.

    Code:
    isc.ImgButton.create({
        ID: "alignLeft",
        size: 45,
        src: "icons/24/text_align_left.png",
        showRollOver: false,
        showFocused: false, click: function(){this.setProperty("baseStyle", "");this.redraw();},
        baseStyle: "myOtherGridCellSelected"
    });
    Code:
    isc.ImgButton.create({
        ID: "alignLeft",
        size: 45,
        src: "icons/24/text_align_left.png",
        showRollOver: false,showDown: false,
        showFocused: false, click: function(){this.setProperty("baseStyle", "myBoxedGridCellOverDark" );this.setProperty("styleName", "myBoxedGridCellOverDark" );this.redraw();},
        baseStyle: "myOtherGridCellSelected"
    });

    #2
    It's being ignored as an apparently invalid styleName - use a blank style definition instead. (eg .emptyStyle {})

    Comment


      #3
      Is this issue completely unrelated to SmartClient?

      Comment


        #4
        Sort of. It could be argued that given a null String SmartClient should wipe out the style property, but that's not what the API does. So you'll need to pass an empty style.

        Comment

        Working...
        X