jqGrid Link Display Text

后端 未结 1 1585
逝去的感伤
逝去的感伤 2020-12-20 05:56

How do I set the display text on a link column in jqGrid. I want the text in every column to just say \"View\" with the link containing the specific Id. Here is what I cur

相关标签:
1条回答
  • 2020-12-20 06:45

    If I correct understand your question you can just use the following simple custom formatter instead of 'showlink' predefined formatter:

    formatter: function (cellvalue, options, rowObject) {
        return '<a href="Consumer/Details?myId=' + opts.rowId + '">View</a>';
    }
    

    If you need to include some additional information in the URL of href you can use properties of the rowObject (rowObject.Date, rowObject.Description) or replace opts.rowId to the cellvalue or rowObject.myId.

    You should additionally verify whether the property edittype: 'select' which you use is correct for the column. It looks like Cut&Paste error, especially because you don't use editable: true property.

    0 讨论(0)
提交回复
热议问题