jQuery   发布时间:2022-03-30  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了jquery – 获取JQGrid格式化程序:’showlink’在MVC中工作大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我的列正在显示,它正在为我的链接生成一个锚点.唯一的问题是网址很糟糕,因为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'}  }                           
                ]

这是它构建的url:@H_772_7@http://localhost:4618/Por/GetBoxesForPorId?id=16

我想要它建立的网址是:@H_772_7@http://localhost:4618/Por/GetBoxesForPorId/16

解决方法

这是你的答案:
function formateadorLink(cellvalue,options,rowObject) {

            return "<a href=/I@L_56_11@mas/Edit/"+ cellvalue + ">" + cellvalue + "</a>";
        }

在网格定义中:

colmodel: [
                        { name: 'id_i@L_56_11@ma',index: 'id_i@L_56_11@ma',width: 100,align: 'left',formatter: formateadorLink
                        },{ name: 'nombre',index: 'nombre',align: 'left' }
                  ],

大佬总结

以上是大佬教程为你收集整理的jquery – 获取JQGrid格式化程序:’showlink’在MVC中工作全部内容,希望文章能够帮你解决jquery – 获取JQGrid格式化程序:’showlink’在MVC中工作所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。