JQGrid禁用/启用 - 格式化程序:'showlink'

时间:2012-09-13 05:24:44

标签: jqgrid-formatter

基于某些条件,我想动态地启用或禁用我的javascript函数中Name列的链接。下面是我的网格代码:

jQuery("#paygrid").jqGrid({
url: url+'Payment/paymentList',
datatype: "xml",
colNames:["Name","Receiced Amount","Total Amount","Status","Mode","Id"],
colModel:[
    {name:"serviceProviderName",index:"serviceProviderName", width:180, align:"center",xmlmap:"serviceProviderName",formatter: 'showlink',
                               formatoptions: { baseLinkUrl: 'paymentdetail.html', idName: 'paymentId'}
                           },
    {name:"recievedAmount",index:"recievedAmount", width:140, align:"center",xmlmap:"recievedAmount",search: false},
    {name:"totalAmount",index:"totalAmount", width:140, align:"center",xmlmap:"totalAmount",search: false},
    {name:"status",index:"status", width:70, align:"center",xmlmap:"status"},
    {name:"paymentType",index:"paymentType", width:100, align:"center",xmlmap:"paymentType",search: false},
    {name:"paymentId"  ,index:"paymentId", width:200, key: true, hidden:"true", align:"center",xmlmap:"paymentId"}

],
height:250,
rowNum:100,
loadonce: true,
viewrecords: true,
gridview:true,
xmlReader: {
        root: "paymentList",
        row: "payment",
        repeatitems: false
},
toolbar: [true,"top"],
});

提前感谢您的帮助。

0 个答案:

没有答案