<?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: Can't get "url" parameter passed to grid</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/cant-get-url-parameter-passed-to-grid</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/cant-get-url-parameter-passed-to-grid/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>jmcleod3 on Can't get "url" parameter passed to grid</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/cant-get-url-parameter-passed-to-grid#p19809</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/cant-get-url-parameter-passed-to-grid#p19809</guid>
        	        	<description><![CDATA[<p>Solved the problem.</p>
</p>
<p>Within the navGrid, I added "editData:{id:value}" in the add, edit options.</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit3532' value='Select Code' data-codeid='sfcode3532' /></p>
<div class='sfcode' id='sfcode3532'>jQuery(&#34;#contacts&#34;).jqGrid(&#39;navGrid&#39;,&#39;#pager&#39;,<br />&#160;&#160; &#160;&#160;&#160; &#160;{search:false,view:true}, //options<br />&#160;&#160; &#160;&#160;&#160; &#160;{jqModal:true,checkOnUpdate:true,savekey: [true,13], navkeys: [true,38,40], checkOnSubmit : true, reloadAfterSubmit:false, closeOnEscape:true, bottominfo:&#34;Fields marked with (*) are required&#34;, width: 400, <span style=&#34;color: #ff0000;&#34;>editData:{id:value}}</span>, // edit options<br />&#160;&#160; &#160;&#160;&#160; &#160;{jqModal:true,checkOnUpdate:true,savekey: [true,13], navkeys: [true,38,40], checkOnSubmit : true, reloadAfterSubmit:false, closeOnEscape:true,bottominfo:&#34;Fields marked with (*) are required&#34;, width: 400, <span style=&#34;color: #ff0000;&#34;>editData:{id: value}}</span>, // add options<br />&#160;&#160; &#160;&#160;&#160; &#160;{reloadAfterSubmit:false,jqModal:false, closeOnEscape:true}, // del options<br />&#160;&#160; &#160;&#160;&#160; &#160;{}, // search options<br />&#160;&#160; &#160;&#160;&#160; &#160;{navkeys: [true,38,40], height:250, width: 300,jqModal:false,closeOnEscape:true} // view options<br />&#160;&#160; &#160;&#160; )<br />&#160; });</div>
<p>John</p>
]]></description>
        	        	<pubDate>Thu, 16 Sep 2010 17:36:32 +0300</pubDate>
        </item>
        <item>
        	<title>jmcleod3 on Can't get "url" parameter passed to grid</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/cant-get-url-parameter-passed-to-grid#p19808</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/cant-get-url-parameter-passed-to-grid#p19808</guid>
        	        	<description><![CDATA[<p>Thanks for the quick reply, Oleg.</p>
</p>
<p>Your solution helped me very much.</p>
</p>
<p>Do you think that there&#39;s a similar solution for the &#39;editurl&#39;?</p>
</p>
<p>Thanks again,</p>
</p>
<p>John</p>
]]></description>
        	        	<pubDate>Thu, 16 Sep 2010 15:57:10 +0300</pubDate>
        </item>
        <item>
        	<title>OlegK on Can't get "url" parameter passed to grid</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/cant-get-url-parameter-passed-to-grid#p19799</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/cant-get-url-parameter-passed-to-grid#p19799</guid>
        	        	<description><![CDATA[<p>First of all you should be careful with the usage of url in the form "http:www.mysite.com/getgame.php?id=123" because of <a href="http://en.wikipedia.org/wiki/Same_origin_policy" target="_blank">Same Origin&#160;Policy</a>&#160;restrictions. You can get per ajax only data from the same web site. So to have the problem no time you should use always url without protocol, domain and port prefix: "/blabla/getgame.php?id=123" or "getgame.php?id=123".</p>
<p>Because you use HTTP GET for requests to the server and you want append the url with additional parameter "id=123" you can do this without modification of url. Just use <a href="/jqgridwiki/doku.php?id=wiki:options" target="_blank">postData</a> option of jqGrid</p>
<p>postData: {id: 123}</p>
<p>or</p>
<p>postData: {id: myId}</p>
<p>where myId is a var which has the value which you need (like 123).</p>
<p>You can also use functions as a value of some postData properties&#160;like</p>
<p>postData: {id: function() {<br /><span style="font-size: 13.8889px;">&#160;&#160; &#160; &#160; &#160;if (jQuery("#onlyMySw").is(&#39;:checked&#39;)) {<br /><span style="font-size: 13.8889px;">&#160;&#160; &#160; &#160; &#160; &#160; &#160;return 123;<br /><span style="font-size: 13.8889px;">&#160;&#160; &#160; &#160; &#160;} else {<br /><span style="font-size: 13.8889px;">&#160;&#160; &#160; &#160; &#160; &#160; &#160;return 456;<br /><span style="font-size: 13.8889px;">&#160;&#160; &#160; &#160; &#160;}<br /><span style="font-size: 13.8889px;">&#160;&#160; &#160;}<br /><span style="font-size: 13.8889px;">}</span></span></span></span></span></span></span></p>
<p>The last approach has a large advantage, because the function will be called <strong>every time during grid refresh</strong> (for example, in case of choose new sort order or switching between pages and so on. In the example above the url will be appended with parameter id=123 if checkbox with id="onlyMySw" is checked and with id=456 if it is not checked.</p>
<p>To read more about the last approach see my answer on the <a href="http://stackoverflow.com/questions/2928371/how-to-filter-the-jqgrid-data-not-using-the-built-in-search-filter-box/2928819#2928819" target="_blank">stackoverflow.com</a>.</p>
<p>Best regards<br />Oleg&#160;</p></p>
]]></description>
        	        	<pubDate>Wed, 15 Sep 2010 22:42:00 +0300</pubDate>
        </item>
        <item>
        	<title>jmcleod3 on Can't get "url" parameter passed to grid</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/cant-get-url-parameter-passed-to-grid#p19798</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/cant-get-url-parameter-passed-to-grid#p19798</guid>
        	        	<description><![CDATA[<p>Hello all,</p>
<p>I have a grid that works fairly well.&#160; Now, I wish to have a dynamic url.</p>
<p>For example,</p>
<p>http:www.mysite.com/getgame.php?id=123</p>
<p>This will change based on the id.</p>
</p>
<p>Within the grid, I have the &#39;url&#39; set to the page name (getgame.php)</p>
<p>[CODE]</p>
<p>jQuery("#contacts").jqGrid({<br />&#160;&#160;&#160; url:"getgame.php",<br />&#160;&#160;&#160; datatype: &#39;json&#39;,<br />&#160;&#160;&#160; colNames:[&#39;Contact No&#39;,&#39;Last Name&#39;, &#39;First Name&#39;, &#39;Type&#39;,&#39;Email&#39;,&#39;Phone&#39;, &#39;Fax&#39;, &#39;Note&#39;],<br />&#160;&#160;&#160; colModel :[ <br />&#160;&#160;&#160;&#160;&#160; {name:&#39;member_contacts_id&#39;, <br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; index:&#39;member_contacts_id&#39;, <br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; width:100, <br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; hidden:true, <br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; editable:false, <br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; editoptions:{<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; readonly:true,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; size:10<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; }<br />&#160;&#160; &#160;&#160;&#160; }, <br />&#160;&#160;&#160;&#160;&#160; {name:&#39;last&#39;, index:&#39;last&#39;, width:120, align:&#39;right&#39;, editable:true,editoptions:{size:30}}, <br />&#160;&#160;&#160;&#160;&#160; {name:&#39;first&#39;, index:&#39;first&#39;, width:120, align:&#39;right&#39;, editable:true,editoptions:{size:30}},<br />&#160;&#160; &#160;&#160; {name:&#39;type&#39;,<br />&#160;&#160; &#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;index:&#39;type&#39;,<br />&#160;&#160; &#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;width:70,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;hidden:true,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;editable: true,<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;edittype:"select",<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;editoptions:<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;{<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;value:"Coach:Coach;Trainer:Trainer;Referee:Referee"<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;},<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;editrules:{edithidden:true}<br />&#160;&#160; &#160;&#160; }, <br />&#160;&#160; &#160;&#160; {name:&#39;email&#39;, index:&#39;email&#39;, width:200, align:&#39;right&#39;, editable:true,editoptions:{size:30}}, <br />&#160;&#160;&#160;&#160;&#160; {name:&#39;phone&#39;, index:&#39;phone&#39;, width:110, align:&#39;right&#39;, editable:true,editoptions:{size:30}},<br />&#160;&#160; &#160;&#160; {name:&#39;fax&#39;, index:&#39;fax&#39;, width:110, align:&#39;right&#39;, editable:true,editoptions:{size:30}},<br />&#160;&#160; &#160;&#160; {name:&#39;note&#39;,<br />&#160;&#160; &#160;&#160; &#160;&#160;&#160; &#160;&#160; index:&#39;note&#39;, <br />&#160;&#160; &#160;&#160; &#160;&#160;&#160; &#160;&#160; width:100, <br />&#160;&#160; &#160;&#160; &#160;&#160;&#160; &#160;&#160; sortable:false,<br />&#160;&#160; &#160;&#160; &#160;&#160;&#160; &#160;&#160; hidden:true,<br />&#160;&#160; &#160;&#160; &#160;&#160;&#160; &#160;&#160; editable: true,<br />&#160;&#160; &#160;&#160; &#160;&#160;&#160; &#160;&#160; edittype:"textarea", <br />&#160;&#160; &#160;&#160; &#160;&#160;&#160; &#160;&#160; editoptions:{rows:"5",cols:"30"},<br />&#160;&#160; &#160; &#160;&#160;&#160; &#160;&#160; editrules:{edithidden:true}<br />&#160;&#160; &#160;&#160; }<br />&#160;&#160;&#160; ],<br />&#160;&#160;&#160; pager: &#39;#pager&#39;,<br />&#160;&#160;&#160; rowNum:10,<br />&#160;&#160;&#160; rowList:[10,20,30],<br />&#160;&#160;&#160; sortname: &#39;member_contacts_id&#39;,<br />&#160;&#160;&#160; sortorder: &#39;asc&#39;,<br />&#160;&#160;&#160; viewrecords: true,<br />&#160;&#160;&#160; caption: &#39;Contacts&#39;,<br />&#160;&#160; &#160;height:"100%",<br />&#160;&#160; &#160;editurl:"_editContacts.php&#39;",<br />&#160;&#160; &#160;<br />&#160;&#160; &#160;grouping: true,<br />&#160; &#160;&#160;&#160; &#160;groupingView : {<br />&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;groupField : [&#39;type&#39;],<br />&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;groupColumnShow : [false],<br />&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;groupText : [&#39;&#60;b&#62;{0} - {1} Contact(s)&#60;/b&#62;&#39;],<br />&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;groupCollapse : true,<br />&#160;&#160; &#160;&#160;&#160; &#160;groupOrder: [&#39;asc&#39;],<br />&#160;&#160; &#160;&#160;&#160; &#160;groupDataSorted : true<br />&#160; &#160;&#160;&#160; &#160;}<br />&#160; });</p>
<p>[\CODE]</p>
</p>
<p>How do I set and pass the id number that will change?</p>
</p>
<p>Thank you for any help with this.</p>
<p>John</p></p>
]]></description>
        	        	<pubDate>Wed, 15 Sep 2010 20:57:46 +0300</pubDate>
        </item>
</channel>
</rss>