Announcement

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

    SmartClient 6.0 - Focus and scroll into view on cancelEditing

    In SmartClient 6.0, whenever ListGrid editing is dismissed via a call to cancelEditing() the ListGrid is given focus and scrolled into view.
    This behavior is essentially a bug - there is no reason to put focus into the ListGrid body and scroll it into view unless the grid (or editors showing within the grid) had focus before the method was called.

    This patch corrects this issue.
    Note that as of the next SmartClient release (6.1) this patch will no longer be necessary and can and should be removed

    Code:
    //----------------------------------------------------------------------------
    // Isomorphic SmartClient 6.0 patch
    // Purpose: On cancelEditing() don't focus in the ListGrid body, scrolling it into view,
    // if focus was elsewhere on the page
    // 
    // Applies to SmartClient 6.0 builds only
    //----------------------------------------------------------------------------
    if (window.isc && isc.version.startsWith("6.0/")){ 
    isc.ListGrid.addProperties({
        _$hie:isc.ListGrid.getPrototype().hideInlineEditor,
        hideInlineEditor:function(_1,_2) {
            _1 = _1&&(this.hasFocus||this.body.hasFocus||(this.getEditForm()&&this.getEditForm().hasFocus))
            return this._$hie(_1,_2);
        }
    });
    
    
    } else if (window.isc) {
      isc.Log.logWarn("Patch for SmartClient 6.0 builds included in this application. " +
                "You are currently running SmartClient verion '"+ isc.version + 
                "'. This patch is not compatible with this build and will have no effect. " +
                "It should be removed from your application source.");
    
    }
Working...
X