這裏是ColModel:我想在link..I的點擊編輯對話框已附上代碼
{name: "FirstName", index: "FirstName", width: 100, sortable: true, editable:true, formatter: GetRow}
function GetRow(cellvalue, options, rowObject) {
return "<a href='#' class='GetLink'>" + cellvalue + "</a>";
}
$('.GetLink').click(function (rowid) {
var row = $('#grid').jqGrid('getGridParam', 'selrow');
$('#grid').jqGrid('editGridRow', row, { recreateForm: true, closeAfterEdit: true, closeOnEscape: true, reloadAfterSubmit: false });
});
@Oleg ...感謝您的建議和時間......當編輯對話框打開,我得到我修改爲標有鏈接「的 Cellvalue小區名稱還有一個問題是,「; 你能不能給一個解決方案在編輯對話框 – Supreeth
@Supreeth只得到單元格的值:我不知道,我明白你的意思,但我猜你使用'編輯:列TRUE'與自定義格式。通常,人們永遠不需要編輯包含鏈接的列。您應該刪除'editable:true'或使用'editable:false'。通常在列中使用屬性'sortable:false,search:false,editable:false,viewable:false,hidedlg:true',它具有自定義格式化程序。 – Oleg
@Supreeth:如果你確實需要編輯鏈接裏面的文本,那麼你應該在列中提供** unformatter **('unformat'回調)。請參閱[文檔](http://www.trirand.com/jqgridwiki/doku.php?id=wiki:custom_formatter#unformatting)。 unformatter從自定義格式化單元格中獲取*可編輯部分*。 – Oleg