Announcement

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

    SmartClient 6.0 Patch: saveAllEdits() and startQueue/sendQueue

    In SmartClient 6.0 an issue exists whereby if requests are being queued (via a call to RPCManager.startQueue()), and the ListGrid saveAllEdits() method is called, the queue will be sent to the server without waiting for an explicit sendQueue() call.

    This patch will resolve this issue, ensuring that the queue is not automatically sent by the saveAllEdits() method

    Code:
    //----------------------------------------------------------------------------
    // Isomorphic SmartClient 6.0 patch
    // Purpose: Allow standard RPCManager Queueing behavior for the 'ListGrid.saveAllEdits()' method
    // 
    // Applies to SmartClient 6.0 builds only
    //----------------------------------------------------------------------------
    if (window.isc && isc.version.startsWith("6.0/")){ 
    
    isc.ListGrid.addMethods({
    saveAllEdits:
    function(_1,_2){this.$333=this.$333||{};this.$334=this.$334||{};if(_1==null)_1=this.getAllEditRows();if(_1==null)return;if(!isc.isAn.Array(_1))_1=[_1];for(var i=0;i<_1.length;i++){var _4=this.saveEdits(null,null,_1[i],true);if(!_4){if(this.stopOnErrors)return false;else{_1[i]=null;_2=null}}}
    var shouldQueue = (this.dataSource != null && !this.saveLocally),startedQueue = false;
    if (shouldQueue) startedQueue = !isc.RPCManager.startQueue();
    var _6=this.$31e++,_7=this.$333[_6]=[];this.$334[_6]=_2;for(var i=0;i<_1.length;i++){if(_1[i]==null)continue;if(!this.rowHasChanges(_1[i]))continue;_7[_7.length]=_1[i];var _8="this.$335("+_1[i]+","+_6+",colNum,editCompletionEvent,success)";this.saveEdits(null,_8,_1[i])}
    if (startedQueue) isc.RPCManager.sendQueue();
    return true}
    });
    
    } 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