makeURL方法中可以编辑要显示的单元格内容
colModel: { name: "DATESOLD", index: "DATESOLD", width: "250", formatter: makeURL },
function makeURL(cellvalue, options, rowObject) {
alert(cellvalue);//单元格值
alert(rowObject["test"]); //单元格行数据类
alert(options["rowId"]); //Grid类中的属性
alert(options["colModel"]["name"]);
return "<a href='#' style='color: blue' >" + cellvalue + "</a>";
}
本文介绍了一种在表格中编辑单元格内容的方法,通过makeURL函数实现单元格内容的定制化展示,例如将日期字段转化为链接形式。
918

被折叠的 条评论
为什么被折叠?



