Hi, the example helps. About the “link” field, i tried with the following code and the “test” is displayed as text instead of hyperlink. Am I missing something? Thanks.
countryData = [
{
continent:“North America”,
countryName:“United States”,
countryCode:“US”,
area:9631420,
population:298444215,
gdp:12360.0,
independence:new Date(1776,6,4),
government:“federal republic”,
government_desc:2,
capital:“Washington, DC”,
member_g8:true,
article:“http://en.wikipedia.org/wiki/United_states”
},
{
continent:“Asia”,
countryName:“China”,
countryCode:“CH”,
area:9596960,
population:1313973713,
gdp:8859.0,
government:“Communist state”,
government_desc:0,
capital:“Beijing”,
member_g8:false,
article:“http://en.wikipedia.org/wiki/China”
}
];
isc.ListGrid.create({
ID: “countryList”,
width:500, height:224, alternateRecordStyles:true, showAllRecords:true,
canEdit:false,
data: countryData,
fields:[
{name:"countryCode", title:"Flag", width:50, type:"image", imageURLPrefix:"flags/16/", imageURLSuffix:".png", canEdit:false},
{name:"countryName", title:"Country"},
{name:"population", title:"Population",
type:"integer",
formatCellValue:"isc.Format.toUSString(value);"
},
{name:"gdp", title:"GDP ($B)",
type:"float",
formatCellValue:"isc.isA.Number(value) ? value.toUSString(1) : value;"
},
{name:"gdp_percap", title:"GDP (per capita)",
canEdit:false,
align:"right",
formatCellValue: function (value, record) {
if (!isc.isA.Number(record.gdp) || !isc.isA.Number(record.population)) return "N/A";
var gdpPerCapita = Math.round(record.gdp*1000000000/record.population);
return isc.Format.toUSDollarString(gdpPerCapita);
},
sortNormalizer: function (record) {
return record.gdp/record.population;
}
},
{
name: "article",
type: "link"
},
{
name: "test",
type: "link",
formatCellValue: function (value, record) {
return "http://www.yahoo.com"
}
}
]
})