2014-09-24 148 views
0
{ 
     name: 'EmployeeInformation', 
     index: 'EmployeeInformation', 
     width: 15, 
     sortable: true, 
     editable: false, 
     formatter: 'showlink', 
     formatoptions: { 
      //show an modal popup 
     } 
    } 

這是我的jqgrid中的一個表列。當用戶點擊一個鏈接時顯示一個模式彈出框jqgrid

我想要的是當我點擊鏈接按鈕(EmployeeInformation)時,它會顯示一個模式彈出。

+0

如果不知道哪個模態插件在 – 2014-09-24 05:17:18

+0

這是因爲我還沒有任何模態插件,代碼是沒用的。你能開導我嗎? Zee Tee? – 2014-09-25 00:14:55

回答

2

最簡單的方法是使用formatter: 'dynamicLink'代替我在the answer中介紹的formatter: 'showlink'。它允許您定義onClick回調(formatoptions: {onClick: function (rowid, iRow, iCol, cellText, e) {alert('clicked in rowId=' + rowId + ', iRow=' + iRow + ', iCol=' + iCol);}}),如the demo。請參閱here

另一種方式將是定義只是<span>text-decoration: underline; cursor: pointer;風格,而不是<a>和使用beforeSelectRowonCellSelect檢測點擊欄,顯示相應的模式彈出。請參閱the answer,this one,this one和其他相應的代碼示例。

相關問題