<?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: Using JQGrid totally from Client Side</title>
	<link>http://www.trirand.com/blog/?page_id=393/bugs/using-jqgrid-totally-from-client-side</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/bugs/using-jqgrid-totally-from-client-side/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>Cael on Using JQGrid totally from Client Side</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/using-jqgrid-totally-from-client-side#p15044</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/using-jqgrid-totally-from-client-side#p15044</guid>
        	        	<description><![CDATA[<p>Hi,</p>
</p>
<p>Thanks for your response and for your two suggestions; as I wrote I already found a solution (by changing the source code), but your suggestions might be useful to another users. I really hope you consider these changes in the next version. 🙂</p>
</p>
<p>And yes, I posted this topic in the wrong category; sorry for that.</p>
<p>Thanks again,</p>
<p>Cael</p>
]]></description>
        	        	<pubDate>Mon, 22 Feb 2010 15:20:52 +0200</pubDate>
        </item>
        <item>
        	<title>tony on Using JQGrid totally from Client Side</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/using-jqgrid-totally-from-client-side#p14973</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/using-jqgrid-totally-from-client-side#p14973</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>Thanks. We will think on this direction. There are soutions for your problem. In the moment I see two.</p>
</p>
<p>1. Define a dummy existing file in the server and put them in the place of the url. This will solve your problems.</p>
<p>2. You can define a custom button in the navigator for the add and the with succes you can use on button click</p>
<p>addRowData to add a data and immediatley after this to edit the data with editRow.</p>
</p>
<p>Hope this help.</p>
<p>(I wonder &#8211; why you put this in the bugs &#8211; it is more feature like bug.)</p>
<p>Best Regards</p>
<p>Tony</p></p>
]]></description>
        	        	<pubDate>Sat, 20 Feb 2010 09:42:13 +0200</pubDate>
        </item>
        <item>
        	<title>Cael on Using JQGrid totally from Client Side</title>
        	<link>http://www.trirand.com/blog/?page_id=393/bugs/using-jqgrid-totally-from-client-side#p14895</link>
        	<category>Bugs</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/bugs/using-jqgrid-totally-from-client-side#p14895</guid>
        	        	<description><![CDATA[<p>Hi,</p>
</p>
<p>Currently I am using the JQGrid in my project, and one of the  requirements was use inline editing. As my datasource is an JSON, I was  using <strong>datatype=&#39;clientSide&#39;</strong> combined with <strong>cellsubmit=&#39;clientArray&#39;</strong> so this both options allow me use the inline editing - I can update  cell data with no problem</p>
</p>
<p>But the main problem was when I was trying to <strong>add</strong> a new  line to the grid -- first I tried to use the <strong>Add navGrid button </strong>but  I was getting error &#39;cause this button tries to post the new cell data  to an URL -- which wasn&#39;t set up, since I am using only and JSON array  (just for your information, I am populating this array with an ASP.NET  Repeater component). So I got stucked in this error, until I read your  JQGrid source code - when I realized that I could download the source  edition and do my changes, so I could use the Grid <strong>totally from  Client Side</strong>.</p>
<p>And that&#39;s what I&#39;ve done. I downloaded the source of version 3.6.3  and added some lines in the file <strong>grid.formedit.js - </strong>at  function <strong>postIt()</strong></p>
<p>At line 793, you try to get the URL. If there&#39;s not URL set, you set  false to the ret[0] (that has the return value) and show the error  message. See below the code snippet:</p>
<p><input type='button' class='sfcodeselect' name='sfselectit3738' value='Select Code' data-codeid='sfcode3738' /></p>
<div class='sfcode' id='sfcode3738'>gurl = rp_ge.url ? rp_ge.url :  $($t).jqGrid(&#39;getGridParam&#39;,&#39;editurl&#39;);<br />if(ret[0]) {<br />&#160;&#160;&#160; if(!gurl)  { ret[0]=false; ret[1] += &#34; &#34;+$.jgrid.errors.nourl; }<br />}</div>
</p>
<p>The change I did:</p>
<p>If there&#39;s no URL set, I continue the same idea (identify the action -  add or update, raise the events, set and remove the class <em>ui-state-active</em>,  and so on), <strong>but I jump over the code that post the data to the  URL</strong>. So, basically,&#160; if there&#39;s no URL set up, <strong>do not  post the data</strong>. As improvement to the next version, you could do  this verification:</p>
</p>
<p>If is there any Post URL defined?</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; True: do the post to that URL</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; False: If is <strong>datatype</strong> set to &#39;<strong>clientSide&#39;</strong></p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; True: don&#39;t do the post action</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; False: Throw the error "There is not URL  defined!"&#160; (the same you&#39;re using currently)</p>
<p>Let me know what do you think about.</p>
<p>I strongly suggest you to add this change to the new version, because  may there people who wants to use your JQGrid but <strong>only with  local data</strong> ie. they want to Add, Remove or update data in the  grid <strong>but don&#39;t post any data while doing these actions</strong>.  With this change they can keep their data array updated with the  function <strong>getChangedCells</strong>() or get any new line added  with the <strong>AfterComplete </strong>event (another modification I  did - now I am passing the parameter postdata (used in the scope of the  function <strong>postIt</strong> ) to this event, so I can access what  data was added and update my local array - probably you&#39;ll want to  consider this change also).</p>
</p>
<p>Another suggestion - this one is harder to do - is: accept an array  if the datatype == &#39;<strong>clientSide&#39; </strong>and keep this array  updated with the actions of the users: For example, what if we could be  able to:</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit8430' value='Select Code' data-codeid='sfcode8430' /></p>
<div class='sfcode' id='sfcode8430'>
<p>var my_array = [<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; { column1: &#34;data1&#34; ,&#160; column2:  &#34;00:30&#34;, column3: &#34;2010-02-12&#34;, column4: &#34;something&#34;},</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; { column1: &#34;data2&#34; ,&#160; column2: &#34;00:31&#34;, column3:  &#34;2010-02-12&#34;, column4:  &#34;example&#34;},</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; { column1: &#34;data3&#34; ,&#160; column2: &#34;00:32&#34;, column3:  &#34;2010-02-12&#34;, column4:  &#34;foo&#34;}</p>
<p>];</p>
</p>
<p>jQuery(&#34;#selector&#34;).jqGrid({<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; datatype:  &#34;clientSide&#34;,</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; clientArray: my_array, //new option proposed</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; colNames: [&#39;String Column&#39;, &#39;Time Column&#39;, &#39;Date  Column&#39;, &#39;Something Else&#39;],</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; colModel: [&#39; ........</p>
</p>
<p>});</p>
</div>
<p>And internally you handle this <strong>my_array</strong> and keep it  updated no matter the action chose - add, remove or delete - so  everytime the user access this array it will have the same data than  JQGrid does.</p>
</p>
<p>Waiting for any response,</p>
<p>Cael</p>
]]></description>
        	        	<pubDate>Wed, 17 Feb 2010 14:05:21 +0200</pubDate>
        </item>
</channel>
</rss>