Currently I'm trying to enable or disable a ListGrid field Editable based on change event of a combo item. I've written a code to disable the column initially. I want to enable the field based on the continent selection. If it if Asia it should be disabled and for other continent it should be disabled. I've written a change event for the continent field. But not sure how to make contryName field editable or non-editable. Please let me know how to implement this.
Thanks in advance.
Thanks in advance.
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", change:"alert ('Set countryName editable here')"},
{name:"member_g8"},
{name:"population", formatCellValue:"isc.Format.toUSString(value);"},
{name:"independence"}
],
autoFetchData: true,
canEdit: true,
canEditCell : function (rowNum, colNum) {
var canEdit = this.Super("canEditCell", arguments);
// do your custom processing and return a custom value
var record = null;
record = this.getRecord(rowNum);
if (record != null) {
if ((colNum == 1) && (record.continent == "Asia") )
return false;
}
// otherwise return the returnValue of the superclass implementation
return canEdit;
},
editEvent: "click"
})
Comment