<?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: JqGrid's strange behavior.</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/jqgrids-strange-behavior</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/jqgrids-strange-behavior/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>tony on JqGrid's strange behavior.</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/jqgrids-strange-behavior#p28614</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/jqgrids-strange-behavior#p28614</guid>
        	        	<description><![CDATA[<p>Hello,</p>
</p>
<p>I do not think that this is&#160; a jqGrid problem. If the other two identical grids work then I think the problem is in your server code.</p>
<p>Please check what you do at server side? What you return?</p>
<p>The way you refresh the grid I think is not correct. If you reload the grid try to reload it in setTimeout function.</p>
<p>The simple test would be - do not refresh it automaticaly - just add a record and refresh it with refresh button.</p>
</p>
<p>Regards</p></p>
]]></description>
        	        	<pubDate>Tue, 09 Apr 2013 11:46:13 +0300</pubDate>
        </item>
        <item>
        	<title>ankit.zaveri on JqGrid's strange behavior.</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/jqgrids-strange-behavior#p28609</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/jqgrids-strange-behavior#p28609</guid>
        	        	<description><![CDATA[<p>Hello Guys,</p>
</p>
<p>I am working on ASP.NET MVC application and using jqGrid 4.4.4 to bind my lsit to grid. I have three identical views whica contains same functionalities related to CRUD operations. I am using jqgrid&#39;s inline add functionality to add new row in grid. My two views are working perfect but my one view is not reloading grid items after adding a record or deleting a record from grid. Below are jqGrid code that I am using to build jqgrid.</p>
</p>
<p>$("#myGrid").jqGrid({</p>
<p>url: &#39;@Url.Content("~/Content/GetData")&#39;,</p>
<p>datatype: "json",</p>
<p>colModel: [</p>
<p>{ name: &#39;ID&#39;, index: &#39;ID&#39;, label: &#39;ID&#39;, clickable: false, hidden: true, editable: false },</p>
<p>{ name: &#39;Title&#39;, index: &#39;Title&#39;, label: &#39;Brand&#39;, width: 150, editable: true, edittype: &#39;text&#39;, editrules: { required: true, custom: true, custom_func: validateValue }, formoptions: { elmsuffix: &#39;(*)&#39; }, sortable: true },</p>
<p>//{ name: &#39;ModifiedOn&#39;, index: &#39;ModifiedOn&#39;, label: &#39;Modified on&#39;, width: 80, editable: false, sortable: true, formatter: &#39;date&#39; },</p>
<p>{ name: &#39;Actions&#39;, width: 60, fixed: true, sortable: false, search: false, resize: false, formatter: &#39;actions&#39;, formatoptions: { keys: true, editbutton: true, delbutton: true } }</p>
<p>],</p>
<p>caption: "Grid Data",</p>
<p>mtype: "GET",</p>
<p>rowNum: 1000,</p>
<p>rowList: [10, 20, 30],</p>
<p>shrinkToFit: true,</p>
<p>width: 980,</p>
<p>height: 200,</p>
<p>jsonReader: {</p>
<p>root: "Rows",</p>
<p>page: "Page",</p>
<p>total: "Total",</p>
<p>records: "Records",</p>
<p>repeatitems: false,</p>
<p>userdata: "UserData",</p>
<p>id: &#39;ID&#39;</p>
<p>},</p>
<p>onSortCol: function (index, columnIndex, sortOrder) {</p>
</p>
<p>var sortcolumn = index + " " + sortOrder;</p>
</p>
<p>if (sortstring.search(index) != -1) {</p>
<p>if (sortOrder == &#39;asc&#39;)</p>
<p>sortstring = sortstring.replace(index + " desc", index + " asc");</p>
<p>else</p>
<p>sortstring = sortstring.replace(index + " asc", index + " desc");</p>
<p>}</p>
<p>else {</p>
<p>if (sortstring != "")</p>
<p>sortstring = sortstring + "," + sortcolumn;</p>
<p>else</p>
<p>sortstring = sortcolumn;</p>
<p>}</p>
</p>
<p>$(&#39;#myGrid&#39;).jqGrid(&#39;setGridParam&#39;, { sortname: sortstring });</p>
<p>},</p>
<p>pager: &#39;#pager1&#39;,</p>
<p>sortname: &#39;Title&#39;,</p>
<p>viewrecords: true,</p>
<p>sortorder: "desc",</p>
<p>scroll: true,</p>
<p>reloadAfterSubmit: true,</p>
<p>emptyrecords: &#39;No records to display...&#39;,</p>
<p>ajaxGridOptions: { cache: true },</p>
<p>loadonce: false,</p>
<p>editurl: &#39;@Url.Content("~/Content/ManageData")&#39;,</p>
<p>});</p>
<p>$("#myGrid").jqGrid(&#39;navGrid&#39;, &#39;#pager1&#39;, { edit: false, add: false, del: false, search: false });</p>
<p>jQuery("#myGrid").jqGrid(&#39;inlineNav&#39;, "#pager1", { edit: false });</p>
</p>
<p>The problem I was facing previously was, after adding a new row, grid was not updating on client side. so I have passed a jason keyword from my controller action and on reload the grid on AjaxSuccess event. See below code block.</p>
</p>
<p>$(document).ajaxSuccess(function (event, request, settings, exception) {</p>
</p>
<p>if ((request.responseText.toLowerCase() == ""add"") &#124;&#124; (request.responseText.toLowerCase() == "add")) {</p>
<p>$("#myGrid").trigger(&#39;reloadGrid&#39;);</p>
<p>}</p>
<p>});</p>
</p>
<p>This is working fine for my two pages but somehow it&#39;s not reloading grid after adding/deleting item to/from grid. While looking at request, i found that after calling my controller action to add/update record, grid is not calling controller action to get grid data specifically for this page.</p>
</p>
<p>Please share your ideas with me if I am missing something here.</p>
</p>
<p>Thanks,</p>
]]></description>
        	        	<pubDate>Tue, 09 Apr 2013 01:14:44 +0300</pubDate>
        </item>
</channel>
</rss>