<?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: EditRow using CometD Bayeux server - (streaming service channels)</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/editrow-using-cometd-bayeux-server-streaming-service-channels</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/editrow-using-cometd-bayeux-server-streaming-service-channels/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>basil on EditRow using CometD Bayeux server - (streaming service channels)</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/editrow-using-cometd-bayeux-server-streaming-service-channels#p25359</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/editrow-using-cometd-bayeux-server-streaming-service-channels#p25359</guid>
        	        	<description><![CDATA[<p>Hi,</p>
<p>&#160;&#160;&#160; I am not using a REST sever, but a channel based streaming server.... (cometd with extensions)</p>
<p>I would like to be able to use EditRow and get the call to the sever to be a function that I write.</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit3854' value='Select Code' data-codeid='sfcode3854' /></p>
<div class='sfcode' id='sfcode3854'>
<p>function cometd_data(postdata){</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160; sdata=get_data(postsdata);</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160; grid[0].addJSONData(sdata);</p>
<p>&#160; &#160; &#160;&#160; grid.jqGrid(&#39;setGridParam&#39;,{datatype:&#39;local&#39;});</p>
<p>};</p>
</p>
<p>function my_proxy(s.t){</p>
<p>&#160;&#160;&#160;&#160; alert(&#34;my_proxy: is here&#34;);</p>
<p>};</p>
</p>
<p>function s_func(p){</p>
<p>&#160;&#160;&#160;&#160; alert(&#34;edit: success function here&#34;);</p>
<p>&#160;&#160;&#160;&#160; return true;</p>
<p>};</p>
</p>
<p>grid.jqGrid({<br />&#160;&#160; &#160;&#160;&#160;&#160; datatype: cometd_data, <br />&#160;&#160; &#160;&#160;&#160;&#160; dataProxy: my_proxy,<br />&#160;&#160; &#160;&#160;&#160;&#160; useDataProxy: true,<br />&#160;&#160; &#160;&#160;&#160;&#160; mtype: &#39;GET&#39;,<br />&#160;&#160; &#160;&#160;&#160;&#160; colNames:colNames,</p>
<p>&#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; .&#160;&#160; &#160;&#160;</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; editurl: null,</p>
<p>&#160; &#160; &#160;&#160;&#160; onSelectRow: function(id) {</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (id &#38;&#38; id !== lastsel) {</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160; grid.jqGrid(&#39;restoreRow&#39;,lastsel);<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; lastsel = id;<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160; }<br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160; <br />&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160; grid.jqGrid(&#39;editRow&#39;, id, true,null,s_func);</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160; }</p>
<p>}</p>
</div>
<p>So I have tried using the dataProxy- but the function my_proxy never gets called, nor does s_func, I get a 404 with a null page as it tries to use a non existant edit url. The dataype function works fine. What am I doing wrong?</p>
<p>&#160;&#160;&#160; ( I have got the edits working by setting the edit url in the editRow function to &#39;clientArray&#39; saving locally and the using the afterSave function to actually send the data to the server but I think this is rather messy and difficult to restore the original row data if the edit on the server fails)</p>
<p>thanks</p>
<p>B</p>
<p style="padding-left: 60px;">&#160;</p>
]]></description>
        	        	<pubDate>Fri, 09 Dec 2011 16:44:54 +0200</pubDate>
        </item>
</channel>
</rss>