Getting all record values in ListGrid

Hi,
Consider a listGrid, which has initally 5 records from dataBase, now edit any one records, dont save the changes. My requirement in this case is, i need to get all the record values both edited and unedited.

In the below example, edit any record and select that record, and while clicking on Print button, you wont get the edited value instead getting the db value. But there is a method getEditedRecord() to get the edited value. But my requirement is, make some records edited and some records unedited, now apply selectAll(), and by getSelection() get all the records and print the va;ue, you will be getting only the db value and not the edited value. I need both edited and unedited values.

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,
     autoSaveEdits : false,
    // 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"}
    ],
    autoFetchData: true,
    canEdit: true,
    editEvent: "doubleClick",
    listEndEditAction: "next"
})

isc.IButton.create({
    top:250,
    title:"Edit New",
    click:"countryList.startEditingNew()"
});

isc.IButton.create({
    top:250, left:270,
    title:"Print",
    click: function() {
        var record = countryList.getSelectedRecord();
        alert(record.countryName);
    }
});

Hi Tamal,
The best way to do this is to simply iterate through the selection and call ‘getEditedRecord()’ on each record to ensure you have the combined value.
We don’t currently have an API to do this for you - feel free to post a request in our wishlist forum for this if you like.

var selection = countryList.getSelection();
for (var i =0; i < selection.length; i++) {
    var rowNum = countryList.data.indexOf(selection[i]);
    selection[i] = countryList.getEditedRecord(rowNum);
}
isc.warn(isc.Log.echoAll(selection));

Thanks
Isomorphic Software

Hi,
Thanks for your reply, it works fine…