Announcement

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

    Bug with ListGrid.saveAllEdits() callback not firing

    Hello,

    I am seeing an issue where the callback to ListGrid.saveAllEdits is not firing when multiple new rows are added to an empty grid before calling saveAllEdits. If you enter just 1 new row, the callback fires. But, multiple new rows and the callback does not fire.

    I've recreated this in your Feature Explorer here:
    http://www.smartclient.com/#enterNewRows

    Simply paste in the following modifications to the default code.Then, when you enter one new record and click the "Save All Edits" button, the callback fires but if you enter mutiple new records and then click the "Save All Edits" button, the callback does not fire.

    Code:
    isc.ListGrid.create({
        ID: "countryList",
        width:500, height:224, alternateRecordStyles:true, showAllRecords:true, cellHeight:22,
        // use server-side dataSource so edits are retained across page transitions
        dataSource: countryDS,
        // display a subset of fields from the datasource
        fields:[
            {name:"countryName"},
            {name:"continent"},
            {name:"member_g8"},
            {name:"population", 
             formatCellValue:"isc.Format.toUSString(parseInt(value))"},
            {name:"independence"}
        ],
        canEdit: true,
        editEvent: "click",
        autoSaveEdits:false,
        listEndEditAction: "next"
    })
    
    isc.IButton.create({
        top:250,
        title:"Edit New",
        click:"countryList.startEditingNew()"
    });
    
    isc.IButton.create({
        top:280,
        title:"Save All Edits",
        click:"countryList.saveAllEdits(null,'alert(\"callback fired\");')"
    });

    #2
    Hi Senordhuff
    This one took some digging but we found the problem and have a fix.

    Here's a patch that should resolve it against the 6.5 release. Let us know if it doesn't do the trick for you.
    This patch should only be applied to this build - it will not be required and could have unforseen side effects when you update to our next release.

    Thanks
    Isomoprhic Software

    Code:
    isc.ListGrid.addProperties({
        _newRecordForEditValues:isc.ListGrid.getPrototype().newRecordForEditValues,
        newRecordForEditValues:function (editValuesID, record) {
            this._newRecordForEditValues(editValuesID, record);
            var session = this.getEditSession(editValuesID);
            if (session) delete session.$33i;
        }
    })

    Comment


      #3
      Wow, that patch looks kind of scary. But, hey, it does the trick. Thanks!

      Comment


        #4
        Hello I have exact the same problem, although it happens using more then 2 added rows. I am using the nightly build SC_SNAPSHOT-2011-06-20.

        The error that is logged is in the order of:
        Code:
        isc_ListGrid_0):getRange(2, 3): start beyond end of rows, returning empty list
        I call saveAllEdits with an array of visual visible rownumbers. The rows are added through startEditingNew, so edits are available.

        1 or 2 rows no problems, but after 2 rows the error above and execute() from the Function callback is not fired.

        I've tried to create a simple testcase, but it does not happen using a clientonly datasource.

        Comment

        Working...
        X