Announcement

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

    Bug in ToolStripGroup / RibbonGroup removeControl()

    SmartClient Version v9.1p_2014-07-20/Enterprise Deployment (2014-07-20)

    Bowser: Chrome & Firefox

    In a ribbon bar I have a group with 4 buttons on 2 rows by 2 columns.
    Than I call ribonGroup.removeControl(control) which is supposed to remove one control from the group.

    Instead it removes all the controls from the column where the removed control is.

    Doing some debugging, led me to the following code in ISC_Foundation.js:

    Code:
       removeControl : function (control) {
            control = isc.isAn.Object(control) ? control : this.getMember(control);
            if (!control) return null;
    
            var column = this.getControlColumn(control);
    
            if (column) {
                column.removeMember(control);
                this.controls.remove(control);
                if (column.members.length <= 1) {
                    // if the column is now empty, destroy it
                    column.hide();
                    this.body.removeMember(column);
                    column.markForDestroy();
                    column = null;
                }
            }
    
            if (this.body.members.length == 0 && this.autoHideOnLastRemove) {
                // hide ourselves
                this.hide();
            }
        },
    The condition if (column.members.length <= 1) is triggered when I remove the control and this forces the entire column to be removed, because I only have 2 members in that column.

    Changing this condition to if (column.members.length <= 0) resolves the issue.

    This happens in the "debug" modules as well as in the "release" modules. I can use my own patched version of ISC_Foundation.js, but I prefer using the official release in order to avoid maintenance conflicts in the future.

    #2
    Thanks for the notification and analysis. We've made a change to address this. Should be present in the next nightly build, dated Feb 20 or above
    (9.1p, 10.0p and 10.1d branches)

    Regards
    Isomorphic Software

    Comment

    Working...
    X