Announcement

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

    SmartClient 6.5.1: Patch for issue: Rows duplicated after edit in grouped ListGrids

    In SmartClient 6.5.1, if the grouped field of a row is modified, two copies of the row will appear in its new group.

    Apply this patch to resolve the issue:

    Code:
    //----------------------------------------------------------------------------
    // Isomorphic SmartClient 6.5.1 patch
    // Purpose: Prevent duplicate records from appearing on a grouped ListGrid when the records
    // are edited.
    // 
    // Applies to SmartClient 6.5.1 build only
    // Version 2
    //----------------------------------------------------------------------------
    if (window.isc && isc.version.startsWith("6.5.1/") ){
        if (isc.ListGrid) {
            isc.ListGrid.addMethods({
    $50u:function(_1,_2,_3,_4,_5,_6){
        var _7;
        for(var i in _4){
            var _9=(_5==null?null:_5[i]);
            if(_4[i]==_9)continue;
            var _10=this.fields.find(this.fieldIdProperty,i);
            if(this.isGrouped&&this.groupByField.contains(_10.name)){_7=true}
            this.$34a(_1,_10,_4[i],_9,_2,this.fields.indexOf(_10))
        }
        if(_7){
            this.$34v=true;
            var _11=_1;
            if(this.dataSource&&!this.saveLocally){
                var _12=this.groupTree.idField;_11=_6.$52s
            }
            var _13=this.data.getParents(_11);
            if(!this.data.remove(_11)){return}
            for(var i=0,j=this.groupByField.length-1;i<_13.length-1;i++){
                var _15=_13[i];
                if(_15.groupMembers.getLength()==0){
                    this.data.remove(_15)
                }else{
                    var _16=this.fields.find("name",this.groupByField[j]);
                    if(_16.getGroupTitle){
                        _15.singleCellValue=_16.getGroupTitle(_15.groupValue,_15,_16,_16.name,this)
                    }
                }
            j--
            }
            this.$52u(_1,true);this.$34v=false;this.$34u()
        }
    }
    })
        }
    } else if (window.isc) {
      isc.Log.logWarn("Patch for SmartClient 6.5.1 build 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.");
    
    }
    Last edited by Isomorphic; 28 Oct 2008, 17:48. Reason: Updated patch.

    #2
    This patch has been updated; please replace the original patch with the patch labelled "Version 2" in its comment.

    Comment

    Working...
    X