Go Back   SmartClient Forums > Technical Q&A
Wiki Register Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 15th May 2008, 07:24
senordhuff
Guest
 
Posts: n/a
Default 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\");')"
});
Reply With Quote
  #2  
Old 16th May 2008, 11:52
Isomorphic Isomorphic is offline
Administrator
 
Join Date: May 2006
Posts: 30,524
Default

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;
    }
})
Reply With Quote
  #3  
Old 16th May 2008, 12:08
senordhuff
Guest
 
Posts: n/a
Default

Wow, that patch looks kind of scary. But, hey, it does the trick. Thanks!
Reply With Quote
  #4  
Old 24th Jun 2011, 07:53
dencel dencel is offline
Registered Developer
 
Join Date: Jul 2010
Posts: 93
Default

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.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search


© 2010,2011 Isomorphic Software. All Rights Reserved