jqgrid格式编号和一个单元格中的链接

时间:2013-07-14 14:12:06

标签: jqgrid

是否可以将格式编号作为带有jqGrid的单元格中的链接?有两个格式化程序编号和链接/ showlink

colModel:[
{name:'Balance',index:'Balance',align:'right',formatter: 'showlink', sorttype:"float", summaryType:'sum', formatoptions:{thousandsSeparator:","}},...

我试图将Balance设置为链接,但仍然能够总结分组

TIA

1 个答案:

答案 0 :(得分:3)

是的,你可以!

您可以定义自定义格式化程序,并在自定义格式化程序中调用原始的“数字”和“showlink”格式化程序。

例如the demo使用

formatter: function (cellValue, options, rowObject, action) {
    return $.fn.fmatter.call(this, "showlink",
        $.fn.fmatter.call(this, "number", cellValue, options, rowObject, action),
        options,
        rowObject,
        action);
},
formatoptions: { decimalSeparator: ",", baseLinkUrl: "http://www.google.com/"}

如何看待我使用options自定义格式化程序作为$.fn.fmatter的相应参数。因此,可以使用formatoptions中“number”和“showlink”格式化程序的选项进行混合。