[英]JQgrid: links column formatter doesn't work. Why?
我有一個小問題,但是我不知道該如何解決,所以請幫助我! 在我的JQgrid中,我想添加一個僅包含鏈接的列,並且此鏈接就像圖像一樣。 我有格式化程序,但該列未顯示任何內容。 你能告訴我為什么會這樣嗎? 我想念什么? 列代碼:
colNames:['ID','Nombre','Cliente', 'Marca', 'Agregar soporte'],
colModel :[
{name:'equi_id', index:'equi_id', width:25},
{name:'equi_nombre', index:'equi_nombre', width:90},
{name:'equi_cliente', index:'equi_cliente', width:90},
{name:'equi_marca', index:'equi_marca', width:90},
{name:'soporte', width:90, index:'equi_id', formatter: soporteFormatter}
],
格式化程序:
function soporteFormatter(cellvalue, options, rowObject) {
var cellValue = cellvalue;
return "<a href='nuevo_soporte.php?equi_id="+cellValue+"><img src='../images/edit.gif' alt='" + cellvalue + "' title='" + cellvalue + "' /></a>";
}
先感謝您!
您在href末尾缺少單引號,則應通過行對象獲取equi_id。
function soporteFormatter(cellvalue, options, rowObject) {
var cellValue = rowObject.equi_id;
return "<a href='nuevo_soporte.php?equi_id=" + cellValue + "'><img src='../images/edit.gif' alt='" + cellValue + "' title='" + cellValue + "' /></a>";
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.