Note that there are some explanatory texts on larger screens.

plurals
  1. POjqGrid not rendered when the html page containing the grid is loaded through an ajax call
    primarykey
    data
    text
    <p>I have a html page ( editor.php ) which contains a lot of html pages in the form of jquery tabs. Each tab is loaded through ajax. </p> <p>One of the tab ( oven.php ) has a jqgrid built inside. When i load oven.php through ajax call like below</p> <pre><code>$.ajax({ type: "GET", url: "oven.php", data: "method=" +method+"&amp;mode="+mode, cache: false, async: true, success: function(data){ htdata = data; $("#oven").html(data); }, }); </code></pre> <p>When i do the above the editor.php page doesn't show the grid from oven.php. However if see oven.php page separately, i am able to view the jqgrid.</p> <p>The grid page is as follows.</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /&gt; &lt;title&gt;Oven&lt;/title&gt; &lt;link type="text/css" href="../../css/cupertino/jquery-ui-1.8.16.custom.css" rel="Stylesheet" /&gt; &lt;link rel="stylesheet" type="text/css" media="screen" href="./jquery/src/css/ui.jqgrid.css" /&gt; &lt;link rel="stylesheet" type="text/css" media="screen" href="./jquery/css/ui.jqgrid.css" /&gt; &lt;script type="text/javascript" src="../../js/jquery-1.6.2.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="../../js/jquery-ui-1.8.16.custom.min.js"&gt;&lt;/script&gt; &lt;script src="./jquery/src/i18n/grid.locale-en.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script src="./jquery/js/jquery.jqGrid.min.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="./jquery/js/jquery-1.4.2.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $.jgrid.no_legacy_api = true; $.jgrid.useJSON = true; var lastSelection; &lt;/script&gt; &lt;script type="text/javascript" src="./jquery/src/grid.base.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="./jquery/src/grid.common.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="./jquery/src/grid.formedit.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="./jquery/src/grid.inlinedit.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="./jquery/src/grid.custom.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="./jquery/src/jquery.fmatter.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="./jquery/src/jquery.searchFilter.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="./jquery/src/grid.jqueryui.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="./jquery/js/i18n/grid.locale-en.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="./jquery/js/jquery.jqGrid.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; function() { var lastsel2 = jQuery("#tempset").jqGrid({ datatype: "local", height: 260, width:300, colNames:[ ' ','Rate *C/Min','Value *C', 'Hold Time min', 'Run Time min'], colModel:[ {name:'id',index:'id', width:60, sorttype:"int", editable: true}, {name:'rate',index:'rate', width:40,editable: true,editoptions:{size:"20",maxlength:"30"}}, {name:'value',index:'value', width:40, editable: true,editoptions: {size:"20",maxlength:"30"}}, {name:'holdtime',index:'holdtime', width:50, editable: true,editoptions:{size:"20",maxlength:"30"}}, {name:'runtime',index:'runtime', width:100,editable: false} ], onSelectRow: function(id){ if(id &amp;&amp; id!==lastsel2){ jQuery('#tempset').jqGrid('restoreRow',lastsel2); jQuery('#tempset').jqGrid('editRow',id,true); lastsel2=id; } }, //editurl: "server.php", caption: "Temperature Settings", pager: "#tempset_pager", }); var mydata2 = [ {id:"initial",rate:"",value:"50",holdtime:"60",runtime:"60"}, {id:"Ramp 1",rate:"15",value:"67 ",holdtime:"5",runtime:"66.133"}, {id:"Ramp 2",rate:"20",value:"89",holdtime:"10",runtime:"77.233"}, {id:"Ramp 3",rate:"25",value:"123",holdtime:"3",runtime:"81.593"} ]; for(var i=0;i &lt; mydata2.length;i++) { //alert(mydata2[i].id); jQuery("#tempset").jqGrid('addRowData',mydata2[i].id,mydata2[i]); } jQuery("#tempset").navGrid("#tempset_pager", {}); } &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt; &lt;div style = "margin-left:240px; top: 15px; position:absolute;"&gt; &lt;table id="tempset"&gt;&lt;/table&gt; &lt;div id="tempset_pager"&gt; &lt;/div&gt; &lt;/div&gt; &lt;script&gt; grid(); &lt;/script&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Kindly help.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload