Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Jul 28th, 2012  |  syntax: None  |  size: 1.10 KB  |  views: 252  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. How to access parent grid id from subgrid in jqgrid
  2. if (jqent.isReq) {
  3.     sbGrid.Append("subGrid: true,");
  4.     sbGrid.Append("subGridRowExpanded: function (subgrid_id, row_id) {");
  5.     sbGrid.Append(" $('#' + subgrid_id).html(renderhtmlforSubgrid(subgrid_id, row_id));},");
  6. }
  7.        
  8. function renderhtmlforSubgrid(subgrid_id, row_id) {
  9.     var script = '<div style="margin-left:10px; margin-top:10px; margin-bottom:10px;">';
  10.     script += '<textarea class="txtCommentwatermarkOn" id="txtCommentSection" name="txtCommentSection" rows=2 cols=20>Type your comments here</textarea>';
  11.     script += '<input onclick="RenderModalPopup(' + row_id + ',' + subgrid_id + ',this);" type="image" id="image" src="../../Content/Images/commentIcon.png"/>';
  12.     script += '</div>';
  13.  
  14.     return script;
  15. }
  16.        
  17. function RenderModalPopup(rowid, tableid, event) {
  18.     var dataFromRow = $('#tblArtifact1').jqGrid('getRowData', rowid);
  19.     var PhaseArtifactId = $('#tblArtifact1').jqGrid('getCell', rowid, 'ID');
  20.     ..........................
  21.        
  22. renderhtmlforSubgrid.call(this, subgrid_id, row_id)
  23.        
  24. renderhtmlforSubgrid(subgrid_id, row_id)
clone this paste RAW Paste Data