Asp.net mvc 4 MVC4,在JQuery网格中,必须用picture和be链接重新替换一列,以打开JQdialog

Asp.net mvc 4 MVC4,在JQuery网格中,必须用picture和be链接重新替换一列,以打开JQdialog,asp.net-mvc-4,jqgrid-formatter,jqgrid,Asp.net Mvc 4,Jqgrid Formatter,Jqgrid,我是MVC的初学者。我有一个列,它必须显示为图片(现在它是一个文本),而且当用户单击图片时,它会显示带有新视图的对话框。正如我在谷歌上搜索到的,我只能使用格式化程序一次,那么我应该使用什么来实现它呢 { name: 'SimType', label: 'SimType', template: columntemplates.textTemplate, width: 50, editable: true, editrules: { edithidden: false }, formatter: l

我是MVC的初学者。我有一个列,它必须显示为图片(现在它是一个文本),而且当用户单击图片时,它会显示带有新视图的对话框。正如我在谷歌上搜索到的,我只能使用格式化程序一次,那么我应该使用什么来实现它呢

{ name: 'SimType', label: 'SimType', template: columntemplates.textTemplate, width: 50, editable: true, editrules: { edithidden: false }, formatter: linkFormat2, unformat: linkUnFormat2, editoptions: { disabled: 'disabled' } },


function linkFormat2(cellvalue, options, rowObject) 
{
  var linkUrl = '@Url.Action("GetMobilePhoneModels", "MobilePhoneModel", new { phonenumber = "Id" })'.replace('Id', rowObject['PhoneNumber']);
  return '<span class="MobilePhoneModel"><a href="' + linkUrl + '">' + cellvalue + '</a></span>';
}
{name:'SimType',label:'SimType',模板:columntemplates.textTemplate,宽度:50,可编辑:true,editrules:{edithidden:false},格式化程序:linkFormat2,unformat:linkUnFormat2,editoptions:{disabled:'disabled'},
函数linkFormat2(单元格值、选项、行对象)
{
var linkUrl='@Url.Action(“GetMobilePhoneModels”,“MobilePhoneModel”,new{phonenumber=“Id”})”.replace('Id',rowObject['phonenumber']);
返回“”;
}

function linkFormat2(cellvalue, options, rowObject) 
{
  var cellValueInt = parseInt(cellvalue);
  if (cellValueInt = "mobile")
  return "<img src='../../Content/Images/Devices/mobile.png' width='11px' height='20.75px' alt='" + cellvalue + "' title='" + cellvalue + "' />";
}
函数linkFormat2(单元格值、选项、行对象)
{
var cellValueInt=parseInt(cellvalue);
如果(cellValueInt=“移动”)
返回“”;
}
它单独工作,但不可能同时工作


感谢您的帮助。谢谢。

如果有人需要,我可以通过组合解决:

function linkFormat2(cellvalue, options, rowObject) {
      var cellValueInt = parseInt(cellvalue);
      if (cellValueInt = "mobile")
      {
                    var linkUrl = '@Url.Action("GetMobilePhoneModels", "MobilePhoneModel", new { phonenumber = "Id" })'.replace('Id', rowObject['PhoneNumber']);
                    return '<span class="MobilePhoneModel"><a href="' + linkUrl + '"><img src="../../Content/Images/Devices/mobile.png" width="11px" height="20.75px" alt="' + cellvalue + '" title="' + cellvalue + '" /></a></span>';
      }                    
}
函数linkFormat2(单元格值、选项、行对象){
var cellValueInt=parseInt(cellvalue);
如果(cellValueInt=“移动”)
{
var linkUrl='@Url.Action(“GetMobilePhoneModels”,“MobilePhoneModel”,new{phonenumber=“Id”})”.replace('Id',rowObject['phonenumber']);
返回“”;
}                    
}