标签:
{field:‘id‘,title:‘id‘,width:100,align:‘center‘,formatter:function(value, row, index){
return ‘<span style="color;red" >‘ + value + row.id + index + ‘</span>‘;
}}
value:字段值。
rowData:行记录数据。
rowIndex: 行索引。
$(‘#dg‘).datagrid({ columns:[[ {field:‘userId‘,title:‘User‘, width:80, formatter: function(value,row,index){ if (row.user){ return row.user.name; } else { return value; } } } ]] });
{ title : ‘操作‘, field : ‘opt‘, width : getWidth(0.1), align : ‘center‘, formatter :
function(value, row, index) {
var str = "";
str += ‘<span class="icon_Modify"><a href="javascript:update(\‘‘ + rec.actTypeId +‘\‘);" title="修改"></a></span>‘;
str += ‘<span class="icon_chakan"><a href="javascript:view(\‘‘ + rec.actTypeId + ‘\‘);" title="删除"></a></span>‘;
return str;
}
}
function caozuo(value,index,rowId){
return "<a href=‘javascript:void(0)‘ onclick=‘searchlist("+index.id+","+rowId+")‘ >查询电话清单</a>";
}
function searchlist(i,rowId){
$("#dg").datagrid("selectRow",rowId);
var row = $("#dg").datagrid("getSelected");
console.info(row.cust_ic);
$(‘#callList‘).window({
width:600,
height:400,
modal:true
});
$(‘#dg2‘).datagrid({
url:"../callrecoder/getCallrecoderList.html?cust_id="+row.id
});
$("#callList").window("open");
}
标签:
原文地址:http://www.cnblogs.com/vivianofzw/p/4322559.html