<?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: HTTP Post backk issue in low band width</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/http-post-backk-issue-in-low-band-width</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/http-post-backk-issue-in-low-band-width/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>Muziris on HTTP Post backk issue in low band width</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/http-post-backk-issue-in-low-band-width#p28644</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/http-post-backk-issue-in-low-band-width#p28644</guid>
        	        	<description><![CDATA[<p>&#160;</p>
<p>We found that while saving an edited cell in JQGrid, there is an HTTP POST request which returns the whole page as Response. For improving the performance of our application in low bandwidth (256 kb), we need to avoid this.</p>
</p>
<p>Now the code for updating data source is</p>
</p>
<p>File :- jqgrid.min.js</p>
</p>
<p>&#160;&#160;&#160;&#160;&#160; saveCell: function (d, e) {&#160;&#160;</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; .........&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</p>
<p>a.ajax(a.extend({ url: b.p.cellurl,</p>
<p>data: a.isFunction(b.p.serializeCellData) ? b.p.serializeCellData.call(b, q) : q,</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; type: "POST",&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#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;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;async: true,</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; complete: function (f, i) {...</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ...........</p>
<p>})</p>
<p>}</p>
</p>
<p>The url contains the value&#160; : /sample.aspx?jqGridID=jqgSample&#38;editMode=1</p>
</p>
<p>File :- sample.aspx.cs</p>
</p>
<p>protected void Page_Load(object sender, EventArgs e) { if (Page.Request.QueryString["jqGridID"] != null)</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {</p>
<p>if (jqgSample.AjaxCallBackMode == AjaxCallBackMode.RequestData)</p>
<p>&#160;&#160;&#160;&#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;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; jqgSample.DataSource = DataSource;</p>
<p>jqgSample.DataBind();&#160;&#160;&#160;&#160;&#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;&#160;&#160;&#160; }</p>
<p>}</p>
<p>}</p>
<p>protected void jqgSample_RowEditing(object sender, Trirand.Web.UI.WebControls.JQGridRowEditEventArgs e) {</p>
<p>&#160;&#160;&#160;&#160;&#160; //code for updating data source</p>
<p>}</p>
</p>
<p>During our research,&#160; we found a method to update the data source of Grid with edited value using HTTP GET request, instead of using HTTP Post and JQGridRowEditEvent. The changes are made in the highlighted portion.</p>
</p>
<p>File :- jqgrid.min.js</p>
</p>
<p>&#160;&#160;&#160;&#160;&#160; saveCell: function (d, e) {</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; .........&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;</p>
<p>a.ajax(a.extend({ url: b.p.url,</p>
<p>data: a.isFunction(b.p.serializeCellData) ? b.p.serializeCellData.call(b, q) : q,</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; type: "GET",&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#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;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; async: true,</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; complete: function (f, i) {...</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ...........</p>
<p>})</p>
<p>}</p>
</p>
<p>The url contains the value&#160; : /sample.aspx?jqGridID=jqgSample</p>
</p>
<p>File :- sample.aspx.cs</p>
</p>
<p>protected void Page_Load(object sender, EventArgs e) { if (Page.Request.QueryString["jqGridID"] != null)</p>
<p>&#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;&#160;&#160; if (jqgSample.AjaxCallBackMode == AjaxCallBackMode.RequestData)</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {</p>
<p>if (Page.Request.QueryString["oper"] == "edit") { JQGridRowEditEventArgs eventArg = new JQGridRowEditEventArgs(); eventArg.RowData = Page.Request.QueryString; jqgSample_RowEditing(jqgSample, eventArg); }</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160; jqgSample.DataSource = DataSource;</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160; jqgSample.DataBind();</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</p>
<p>}</p>
<p>}</p>
</p>
<p>protected void jqgSample_RowEditing(object sender,Trirand.Web.UI.WebControls.JQGridRowEditEventArgs e)</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160; {</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; //code for updating data source</p>
<p>}</p>
</p>
<p>Our research result will update the data source of the Grid when the Request QueryString contains the value &#8220;edit&#8221; for the key &#8220;oper&#8221;.</p>
</p>
<p>Is there is any issue using this method ?</p>
</p>
<p>Is there any other method to avoid the POST of the whole page while saving an edited cell ?</p>
</p>
<p>Waiting for a favorable response from you.</p>
</p>
<p>Info: we are using Version: jqSuiteASPNET_4_4_1_0</p>
<p>Thanks in advance</p>
]]></description>
        	        	<pubDate>Sat, 13 Apr 2013 12:38:10 +0300</pubDate>
        </item>
</channel>
</rss>