Announcement

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

    Problem with ListGrid.discardAllEdits()

    Hello, we've noticed that discardAllEdits is not working properly.

    Please see the following example:
    http://www.smartclient.com/index.jsp#editByCell

    Use the following code which ensures that autoSavedEdits is false and then edit multiple rows. If you click the top button that says "Discard All Edits", it does not change the value in the cell back to the original value until you actually click on the cell and then click out. The only cells that are discarded properly are for the currently selected row. The second button for Discarding edits for the current row seems to work fine though.

    Code:
    isc.ListGrid.create({
        ID: "countryList",
        width:550, 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:"countryCode", title:"Flag", width:40, type:"image", imageURLPrefix:"flags/16/", imageURLSuffix:".png", canEdit:false},
            {name:"countryName"},
            {name:"continent"},
            {name:"member_g8"},
            {name:"population", formatCellValue:"isc.Format.toUSString(value)"},
            {name:"independence"}
        ],
        autoFetchData: true,
        autoSaveEdits:false,
        canEdit: true,
        editEvent: "click"
    })
    
    isc.IButton.create({
        top:225,
        width:250,
        title:"Discard All Edits",
        click:"countryList.discardAllEdits();"
    })
    
    isc.IButton.create({
        top:275,
        width:250,
        title:"Discard Edits for Current Row",
        click:"countryList.discardEdits(countryList.getEditRow());"
    })

    #2
    Hi senordhuff
    Thanks bringing this up.
    In 6.5.1 discardAllEdits() doesn't refresh the ListGrid to reflect the dropped edits without an explicit call to markForRedraw().
    So for now you will need to call this method on the ListGrid after your discardAllEdits() call.

    There's no reason for this not to happen automatically as part of the discardAllEdits method - we'll make this change for our next release

    Isomorphic Software

    Comment

    Working...
    X