<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
	<title>jQuery Grid Plugin - jqGrid - Topic: Calling jqGrid from external file injected in a </title>
	<link>http://www.trirand.com/blog/?page_id=393/help/calling-jqgrid-from-external-file-injected-in-a</link>
	<description><![CDATA[Grid plugin]]></description>
	<generator>Simple:Press Version 5.7.5.3</generator>
	<atom:link href="http://www.trirand.com/blog/?page_id=393/help/calling-jqgrid-from-external-file-injected-in-a/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>Luigino on Calling jqGrid from external file injected in a </title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/calling-jqgrid-from-external-file-injected-in-a#p18528</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/calling-jqgrid-from-external-file-injected-in-a#p18528</guid>
        	        	<description><![CDATA[<p>Nevermind&#8230; solved it by myself&#8230;actually!</p>
</p>
<p>Practically I did:</p>
</p>
<p>&#60;script type=&#39;text/javascript&#39; src=&#39;<a href="http://localhost/" rel="nofollow" target="_blank">http://localhost/</a>..../js/i18n/.....?ver=2.9.2&#39;&#62;&#60;/script&#62;</p>
<p>&#60;script type=&#39;text/javascript&#39; src=&#39;<a href="http://localhost/" rel="nofollow" target="_blank">http://localhost/</a>..../js/src/g.....?ver=2.9.2&#39;&#62;&#60;/script&#62;</p>
<p>&#60;script type=&#39;text/javascript&#39; src=&#39;<a href="http://localhost/" rel="nofollow" target="_blank">http://localhost/</a>..../js/jquer.....?ver=2.9.2&#39;&#62;&#60;/script&#62;</p>
</p>
<p>&#60;&#8212;- Where in this jQuery I had</p>
<p>to be sure it was included whatever is necessary for use selecting in download manager page</p>
</p>
<p>then:</p>
</p>
<p>&#60;select name="selecttable" id="selecttable"</p>
<p>onChange="$(&#39;#datatable&#39;).GridUnload(&#39;#datatable&#39;); $.getScript(ajaxcombo(&#39;selecttable&#39;))"&#62;</p>
<p>[...]</p>
</p>
<p>&#60;div id="contentarea"&#62;</p>
<p>&#60;table id="datatable"&#62;&#60;/table&#62;</p>
<p>&#60;div id="pager"&#62;&#60;/div&#62;</p>
<p>&#60;/div&#62;</p>
</p>
<p>in this way it doesn&#39;t need explanations&#8230;</p>
<p>Now I&#39;m going to implement the code relative to manage tables and stuffs&#8230; 🙂</p>
</p>
<p>Thanks anyway tony and compliments for your plugin again 🙂</p>
<p>Be cool!</p>
<p>Ciao</p>
<p>Luigi</p>
]]></description>
        	        	<pubDate>Sun, 11 Jul 2010 15:26:15 +0300</pubDate>
        </item>
        <item>
        	<title>Luigino on Calling jqGrid from external file injected in a </title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/calling-jqgrid-from-external-file-injected-in-a#p18527</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/calling-jqgrid-from-external-file-injected-in-a#p18527</guid>
        	        	<description><![CDATA[<p>Hi tony again...</p>
<p>I figured out the issue is another issue... precisely: in the documentation I saw to use GridUnload I should use grid.loader.js which contains the .js that has the function GridUnload. So I removed the &#60;script&#62; line about loading jquery.jqGrid.min.js since it&#39;s supposed to be already loaded by grid.loader.js....and it&#39;s supposed to create grid the function should be the same as like :</p>
<p>jQuery(document).ready(function(){</p>
<p>jQuery("#list").jqGrid({</p>
<p>url:&#39;example.php&#39;,</p>
<p>datatype: &#39;xml&#39;,</p>
<p>mtype: &#39;GET&#39;,</p>
<p>colNames:[&#39;Inv No&#39;,&#39;Date&#39;, &#39;Amount&#39;,&#39;Tax&#39;,&#39;Total&#39;,&#39;Notes&#39;],</p>
<p>colModel :[</p>
<p>{name:&#39;invid&#39;, index:&#39;invid&#39;, width:55},</p>
<p>{name:&#39;invdate&#39;, index:&#39;invdate&#39;, width:90},</p>
<p>{name:&#39;amount&#39;, index:&#39;amount&#39;, width:80, align:&#39;right&#39;},</p>
<p>{name:&#39;tax&#39;, index:&#39;tax&#39;, width:80, align:&#39;right&#39;},</p>
<p>{name:&#39;total&#39;, index:&#39;total&#39;, width:80, align:&#39;right&#39;},</p>
<p>{name:&#39;note&#39;, index:&#39;note&#39;, width:150, sortable:false}</p>
<p>],</p>
<p>pager: &#39;#pager&#39;,</p>
<p>rowNum:10,</p>
<p>rowList:[10,20,30],</p>
<p>sortname: &#39;invid&#39;,</p>
<p>sortorder: &#39;desc&#39;,</p>
<p>viewrecords: true,</p>
<p>caption: &#39;My first grid&#39;</p>
<p>});</p>
<p>});</p>
<p>But it doesn&#39;t appear...if I load jquery.jqGrid.min.js indeed it appears (but looks like can&#39;t unload it). Why?...I am on apache+mysql+php under windows actually before to upload on linux host... might be that cause?...</p>
<p>Thanks in advance and sorry for this but maybe the documentation doesn&#39;t explain about this possible differences...or yes?...</p>
<p>Ciao</p>
<p>Luigi</p>
]]></description>
        	        	<pubDate>Sun, 11 Jul 2010 12:11:36 +0300</pubDate>
        </item>
        <item>
        	<title>Luigino on Calling jqGrid from external file injected in a </title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/calling-jqgrid-from-external-file-injected-in-a#p18510</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/calling-jqgrid-from-external-file-injected-in-a#p18510</guid>
        	        	<description><![CDATA[<p>found the solution: had just to put jQuery(document).ready(function(){...});</p>
<p>&#160;in different .js files then doing in onChange of the select a $.getScript(&#39;jsfilename.js&#39;); et voil&#224; but I have this little issue:</p>
</p>
<p>&#60;link rel="stylesheet" type="text/css" media="screen" href="js/src/css/ui.jqgrid.css" /&#62;</p>
<p>&#60;link rel="stylesheet" type="text/css" media="screen" href="js/src/css/jquery.searchFilter.css" /&#62;</p>
<p>&#60;script type=&#39;text/javascript&#39; src=&#39;grid.locale-it.js&#39;&#62;&#60;/script&#62;</p>
<p>&#60;script type=&#39;text/javascript&#39; src=&#39;js/src/grid.loader.js&#39;&#62;&#60;/script&#62;</p>
<p>&#60;script type=&#39;text/javascript&#39; src=&#39;jquery.jqGrid.min.js&#39;&#62;&#60;/script&#62;</p>
</p>
<p>&#60;div class="wrap"&#62;</p>
<p>&#60;?php</p>
<p>$dblink = mysql_connect(&#39;94.141.20.174&#39;, &#39;luiginon_luigino&#39;, &#39;plunzl73t23l682d&#39;) or die(&#39;Could not connect: &#39; . mysql_error());</p>
<p>$db_selected = mysql_select_db(&#39;luiginon_db&#39;, $dblink) or die (&#39;Can\&#39;t use luiginon_db : &#39; . mysql_error());</p>
<p>$all_tables = mysql_query("SELECT table_name, table_comment FROM `INFORMATION_SCHEMA`.`TABLES` WHERE `TABLE_SCHEMA` = &#39;luiginon_db&#39; AND `TABLE_NAME` LIKE &#39;vvd_%&#39; ORDER BY `TABLE_NAME`", $dblink) or die (&#39;Query not valid&#39; . mysql_error());</p>
<p>?&#62;</p>
<p>&#60;form&#62;</p>
<p>&#60;select name="selecttable" id="selecttable" onChange="$(&#39;#list&#39;).GridUnload; $.getScript(ajaxcombo(&#39;selecttable&#39;))"&#62;</p>
<p>&#60;option value=""&#62;Select a table...&#60;/option&#62;</p>
<p>&#60;?php</p>
<p>while ($row = mysql_fetch_assoc($all_tables)) {</p>
<p>?&#62;&#60;option value="&#60;?php echo $row[&#39;table_name&#39;]; ?&#62;"&#62;&#60;?php echo $row[&#39;table_comment&#39;]; ?&#62;&#60;/option&#62;&#60;?php</p>
<p>}</p>
<p>mysql_free_result($all_tables);</p>
<p>?&#62;</p>
<p>&#60;/select&#62;</p>
<p>&#60;/form&#62;</p>
<p>&#60;div id="contentarea"&#62;</p>
<p>&#60;div&#62;</p>
<p>&#60;table id="list"&#62;&#60;/table&#62;</p>
<p>&#60;div id="pager"&#62;&#60;/div&#62;</p>
<p>&#60;/div&#62;</p>
<p>&#60;/div&#62;</p>
<p>&#60;/div&#62;</p>
<p>I select different table which doesn&#39;t have a grid or even another grid with different settings, and GridUnload looks like it doesn&#39;t work to re-create the grid or leave original html blank, and maybe you could give me a trick.. any idea? thanks</p>
</p>
<p>Ciao,</p>
<p>Luigi</p>
]]></description>
        	        	<pubDate>Fri, 09 Jul 2010 15:30:23 +0300</pubDate>
        </item>
        <item>
        	<title>Luigino on Calling jqGrid from external file injected in a </title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/calling-jqgrid-from-external-file-injected-in-a#p18485</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/calling-jqgrid-from-external-file-injected-in-a#p18485</guid>
        	        	<description><![CDATA[</p>
<p>Hello everyone!!! </p>
<p>I have this example at <a title="Example page" href="http://www.luigino.netsons.org/mainpage.php" target="_blank"></a><a href="http://www.luigino.netsons.org" rel="nofollow" target="_blank">http://www.luigino.netsons.org</a>.....inpage.php where there&#39;s a combo with elements related to different tables&#8230; this combo is actually managed with sort of xmlhttprequest you can see in this file <a title="javascript to load external contents and scripts" href="http://www.luigino.netsons.org/testlocal.js" target="_blank"></a><a href="http://www.luigino.netsons.org" rel="nofollow" target="_blank">http://www.luigino.netsons.org</a>.....stlocal.js.</p>
<p>Each option I select would load an external php file which should show a jqGrid calling a function that&#39;s inside the external file (like a different jqGrid for each different external file) </p>
<p>The matter is while injecting contents in a DIV from external file through xmlhttprequest won&#39;t load external scripts written in that file to apply, so I found around a sort of a function like:</p>
</p>
<p>function loadobjs() {</p>
<p>&#160;&#160;&#160;&#160;&#160; if (!document.getElementById)</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; return;</p>
<p>&#160;&#160;&#160;&#160;&#160; for (i=0; i&#60;arguments.length; i++) {</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; var file=arguments[i];</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; var fileref="";</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (loadedobjects.indexOf(file)==-1) { //Check to see if this object has not already been added to page before proceeding</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (file.indexOf(".js")!=-1) { //If object is a js file</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; fileref=document.createElement(&#39;script&#39;);</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; fileref.setAttribute("type","text/javascript");</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; fileref.setAttribute("src", file);</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; else if (file.indexOf(".css")!=-1) { //If object is a css file</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; fileref=document.createElement("link");</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; fileref.setAttribute("rel", "stylesheet");</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; fileref.setAttribute("type", "text/css");</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; fileref.setAttribute("href", file);</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (fileref!="") {</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; document.getElementsByTagName("head").item(0).appendChild(fileref);</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; loadedobjects+=file+" "; //Remember this object as being already added to loadedobjects+page;</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</p>
<p>&#160;&#160;&#160; }</p>
<p>}</p>
</p>
<p>loadobjs(), but looks like it doesn&#39;t really load scripts.</p>
<p>So I am thinking to change the whole loading contents and script using jQuery and I found in the documentation a $.load(&#8230;.) to load contents to div and a $.getScript(&#8230;) to load scripts.</p>
<p>So I am here asking  you how I could preload scripts (jquery-1.4.2.js,  grid.locale-it.js and jquery.jqGrid.min.js) while loading (with  $.load() or $.ajax() ) the external file in the &#60;div&#62; then  applying scripts in the &#60;div&#62; so they could be applied once loaded  the content and jqGrid would be executed? I thought about $.getScript()  but how I could use it in this way in the onChange event&#39;s select?</p>
<p>Just so in this way I won&#39;t modify anymore the mainpage.php but just in the future adding new table and creating just a new PHP file with a new jqGrid function for that new table&#8230;</p>
<p>Thanks to everyone in advance!!<br />Ciao<br />Luigi</p>
]]></description>
        	        	<pubDate>Thu, 08 Jul 2010 17:11:21 +0300</pubDate>
        </item>
</channel>
</rss>