<?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: User Var on Ajax Request</title>
	<link>http://www.trirand.com/blog/?page_id=393/feature-request/user-var-on-ajax-request</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/feature-request/user-var-on-ajax-request/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>brett on User Var on Ajax Request</title>
        	<link>http://www.trirand.com/blog/?page_id=393/feature-request/user-var-on-ajax-request#p9228</link>
        	<category>Feature Request</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/feature-request/user-var-on-ajax-request#p9228</guid>
        	        	<description><![CDATA[<p>Formatting of that previous post was awful here is another try:</p>
</p>
<p>I see that there is a way to pass custom information to the browser, but <br />I would like to pass custom data back to the server. Am writing a Rails <br />Hobo plugin for jqGrid and in the final version it will be as easy as <br />dropping a tag &#60;jqgrid/&#62; onto a page to get a context aware jqGrid.</p>
<p>The server side will have to figure out what columns are being <br />requested, so either having colmodel sent back with the request, or a <br />custom var that jqGrid just passively passes back to the server on an <br />Ajax data request/add/update would work great!&#160; Right now I am adding a <br />code to the ajaxurl and caching the colmodel at the server when the <br />server serves the page.&#160; When the json request asking for grid data is <br />received by the server it decodes the ajaxurl to get a key where it <br />looks up the colmodel in a persistent hash.</p>
<p>It would be nicer to just put the colmodel data into a custom user var <br />and have jqGrid just passively pass it back to the server on data <br />requests/adds/updates.&#160; I hope I am being clear here.</p>
<p>For example a var named userrequest:</p>
<p>jQuery("#jqitbl-bookgrid").jqGrid({<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; url: "json-request"<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; ,userrequest: "colModel: [ <br />{name:&#39;title&#39;,index:&#39;title&#39;,editable:true},<br />{name:&#39;year_published&#39;,index:&#39;year_published&#39;,editable:true},<br />{name:&#39;author&#39;,index:&#39;author&#39;,editable:true},<br />{sortable:false,name:&#39;have_read&#39;,index:&#39;have_read&#39;,formatter:&#39;checkbox&#39;,<br />editable:true,edittype:&#39;checkbox&#39;,editoptions:{value:&#39;1:0&#39;}},<br />{name:&#39;date_read&#39;,index:&#39;date_read&#39;,editable:true,formatter:&#39;date&#39;,forma<br />toptions:{srcformat:&#39;Y-m-d&#39;,newformat:&#39;d-M-Y&#39;}}]"<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; ,editurl: "json-edit-request"<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; ,datatype: "json"<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; ,colNames: [&#39;Title&#39;,&#39;Year Published&#39;,&#39;Author&#39;,&#39;Have Read&#39;,&#39;Date <br />Read&#39;]<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; ,colModel: [ {name:&#39;title&#39;,index:&#39;title&#39;,editable:true},<br />{name:&#39;year_published&#39;,index:&#39;year_published&#39;,editable:true},<br />{name:&#39;author&#39;,index:&#39;author&#39;,editable:true},<br />{sortable:false,name:&#39;have_read&#39;,index:&#39;have_read&#39;,formatter:&#39;checkbox&#39;,<br />editable:true,edittype:&#39;checkbox&#39;,editoptions:{value:&#39;1:0&#39;}},<br />{name:&#39;date_read&#39;,index:&#39;date_read&#39;,editable:true,formatter:&#39;date&#39;,forma<br />toptions:{srcformat:&#39;Y-m-d&#39;,newformat:&#39;d-M-Y&#39;}}]<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; ,rowNum: 5<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; ,forcefit: true<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; ,caption: "Books"<br />&#160;&#160;&#160;&#160;&#160;&#160; });</p>
<p>And jqGrid would do nothing with userrequest except that if it exists, <br />pass it back to the server on a data request/update/add/delete.</p>
<p>Doing it this way people don&#39;t have to code their own server response to <br />each grid, they can just drop a &#60;jqgrid/&#62; tag on a page and everything <br />else is taken care of behind the scenes because the server receives <br />metadata with the request.</p>
<p>You can see a screencast of version 1 of the plugin here to get the <br />idea. <a href="http://www.screencast.com/users/blizzardville" rel="nofollow" target="_blank">http://www.screencast.com/users/blizzardville</a></p>
<p>Thanks for creating such a fantastic grid!!!</p>
<p>Brett</p></p>
]]></description>
        	        	<pubDate>Wed, 02 Sep 2009 11:40:10 +0300</pubDate>
        </item>
        <item>
        	<title>brett on User Var on Ajax Request</title>
        	<link>http://www.trirand.com/blog/?page_id=393/feature-request/user-var-on-ajax-request#p9227</link>
        	<category>Feature Request</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/feature-request/user-var-on-ajax-request#p9227</guid>
        	        	<description><![CDATA[<p>I see that there is a way to pass custom information to the browser, but I would like to pass custom data back to the server. Am writing a Rails Hobo plugin for jqGrid and in the final version it will be as easy as dropping a tag &#60;jqgrid/&#62; onto a page to get a context aware jqGrid.</p>
<p>The server side will have to figure out what columns are being requested, so either having colmodel sent back with the request, or a custom var that jqGrid just passively passes back to the server on an Ajax data request/add/update would work great!&#160; Right now I am adding a code to the ajaxurl and caching the colmodel at the server when the server serves the page.&#160; When the json request asking for grid data is received by the server it decodes the ajaxurl to get a key where it looks up the colmodel in a persistent hash.</p>
<p>It would be nicer to just put the colmodel data into a custom user var and have jqGrid just passively pass it back to the server on data requests/adds/updates.&#160; I hope I am being clear here.</p>
<p>For example a var named userrequest:</p>
</p>
<pre id="line178">      jQuery("#jqitbl-bookgrid").jqGrid({<br />         url: "json-request"<br />        ,userrequest: "colModel: [ {name:&#39;title&#39;,index:&#39;title&#39;,editable:true},{name:&#39;year_published&#39;,index:&#39;year_published&#39;,editable:true},{name:&#39;author&#39;,index:&#39;author&#39;,editable:true},{sortable:false,name:&#39;have_read&#39;,index:&#39;have_read&#39;,formatter:&#39;checkbox&#39;,editable:true,edittype:&#39;checkbox&#39;,editoptions:{value:&#39;1:0&#39;}},{name:&#39;date_read&#39;,index:&#39;date_read&#39;,editable:true,formatter:&#39;date&#39;,formatoptions:{srcformat:&#39;Y-m-d&#39;,newformat:&#39;d-M-Y&#39;}}]"<br />        ,editurl: "json-edit-request"<br />        ,datatype: "json"<br />        ,colNames: [&#39;Title&#39;,&#39;Year Published&#39;,&#39;Author&#39;,&#39;Have Read&#39;,&#39;Date Read&#39;]<br />        ,colModel: [ {name:&#39;title&#39;,index:&#39;title&#39;,editable:true},{name:&#39;year_published&#39;,index:&#39;year_published&#39;,editable:true},{name:&#39;author&#39;,index:&#39;author&#39;,editable:true},{sortable:false,name:&#39;have_read&#39;,index:&#39;have_read&#39;,formatter:&#39;checkbox&#39;,editable:true,edittype:&#39;checkbox&#39;,editoptions:{value:&#39;1:0&#39;}},{name:&#39;date_read&#39;,index:&#39;date_read&#39;,editable:true,formatter:&#39;date&#39;,formatoptions:{srcformat:&#39;Y-m-d&#39;,newformat:&#39;d-M-Y&#39;}}]<br />        ,rowNum: 5<br />        ,forcefit: true<br />        ,caption: "Books"<br />       });<br /><br />And jqGrid would do nothing with userrequest except that if it exists, pass it back to the server on a data request/update/add/delete.<br /><br />Doing it this way people don&#39;t have to code their own server response to each grid, they can just drop a &#60;jqgrid/&#62; tag on a page and everything else is taken care of behind the scenes because the server receives metadata with the request.<br /><br />You can see a screencast of version 1 of the plugin here to get the idea. http://www.screencast.com/users/blizzardville<br /><br />Thanks for creating such a fantastic grid!!!<br /><br />Brett<br /><br /></pre>
]]></description>
        	        	<pubDate>Wed, 02 Sep 2009 11:36:18 +0300</pubDate>
        </item>
</channel>
</rss>