我正在构建一个运行良好的 jqgrid ...网格构建
if (jqent.isReq) {
sbGrid.Append("subGrid: true,");
sbGrid.Append("subGridRowExpanded: function (subgrid_id, row_id) {");
sbGrid.Append(" $('#' + subgrid_id).html(renderhtmlforSubgrid(subgrid_id, row_id));},");
}
我有一个带有 textarea 的子网格和一个将由以下代码呈现的图像控件
function renderhtmlforSubgrid(subgrid_id, row_id) {
var script = '<div style="margin-left:10px; margin-top:10px; margin-bottom:10px;">';
script += '<textarea class="txtCommentwatermarkOn" id="txtCommentSection" name="txtCommentSection" rows=2 cols=20>Type your comments here</textarea>';
script += '<input onclick=\"RenderModalPopup(' + row_id + ',' + subgrid_id + ',this);\" type="image" id="image" src="../../Content/Images/commentIcon.png"/>';
script += '</div>';
return script;
}
单击图像“RenderModalPopup”功能将被触发
function RenderModalPopup(rowid, tableid, event) {
var dataFromRow = $('#tblArtifact1').jqGrid('getRowData', rowid);
var PhaseArtifactId = $('#tblArtifact1').jqGrid('getCell', rowid, 'ID');
..........................
每件事都运行良好......现在的问题是我将网格 ID 硬编码为“tblArtifact1”以获取列值。需要删除。我可以得到网格ID吗?是否有任何预定义的参数/函数来获取它?
我被困住了..请帮忙。