In my ListGrid, I would like the user to be able to edit a few cells in one row, and when editing is complete (navigate away, escape, enter, or tab to next row), a confirmation dialog pops up to save or cancel changes.
Here is what I have so far (based on the Modal Editing example):
isc.ListGrid.create({
ID: "countryList",
width:550,
height:224,
alternateRecordStyles:true,
showAllRecords:true,
cellHeight:22,
dataSource: countryDS,
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"}
],
canReorderFields: true,
autoFetchData:true,
canEdit: true,
editEvent: "doubleClick",
modalEditing: true,
waitForSave: true,
rowEndEditAction: "done",
confirmCancelEditing: true, //--default = false
autoSaveEdits: false, //--default = true
rowEditorExit: function () {
return isc.confirm("Save changes?");
}
})
Obviously, I’m not implementing rowEditorExit properly. Where to go next? Add a callback function to isc.confirm to save edits?