我的列正在显示,它正在为我的链接生成一个锚点.唯一的问题是网址很糟糕,因为MVC
这是colModel:
colModel: [ { name: 'RegName',index: 'RegName',label: 'Region Name',width:90,align: 'center' },{ name: 'AccessNbr',index: 'AccessNbr',label: 'Access Number',width:80,align: 'center',formatter: 'showlink',formatoptions: {baseLinkUrl: '',showAction: 'GetBoxesForPorId',addParam: ''} },{ name: 'TransmitedDt',index: 'TransmitedDt',label: 'TransmitedDt',{ name: 'BoxCount',index: 'BoxCount',label: 'Box Count',{ name: 'PorId',hidden:false,index: 'PorId',label: 'Por ID',key:true,formatter:'link',formatoptions: {target:'_new'} } ]
解决方法
这是你的答案:
function formateadorLink(cellvalue,options,rowObject) { return "<a href=/Idiomas/Edit/"+ cellvalue + ">" + cellvalue + "</a>"; }
在网格定义中:
colModel: [ { name: 'id_idioma',index: 'id_idioma',width: 100,align: 'left',formatter: formateadorLink },{ name: 'nombre',index: 'nombre',align: 'left' } ],