0
    {
        name: 'EmployeeInformation',
        index: 'EmployeeInformation',
        width: 15,
        sortable: true,
        editable: false,
        formatter: 'showlink',
        formatoptions: {
            //show an modal popup
        }
    }

This is a table column in my jqgrid.

What I want is when i click the link button (EmployeeInformation) it will show a modal popup.

1 Answers1

2

The simplest way will be to use formatter: 'dynamicLink' instead of formatter: 'showlink' which I introduced in the answer. It allows you to define onClick callback (formatoptions: {onClick: function (rowid, iRow, iCol, cellText, e) {alert('clicked in rowId=' + rowId + ', iRow=' + iRow + ', iCol=' + iCol);}}) like in the demo. See here too.

One more way will be to define just <span> with text-decoration: underline; cursor: pointer; style instead of <a> and to use beforeSelectRow or onCellSelect to detect the click in the column to show the corresponding modal popup. See the answer, this one, this one and other for the corresponding code examples.

Community
  • 1
  • 1
Oleg
  • 220,925
  • 34
  • 403
  • 798