<?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: Stop running this script error</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/stop-running-this-script-error</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/stop-running-this-script-error/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>OlegK on Stop running this script error</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/stop-running-this-script-error#p23006</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/stop-running-this-script-error#p23006</guid>
        	        	<description><![CDATA[<p>You should not post 20,000 rows to the client side. Native code of SQL Server can do sorting and paging of data much effectively as it can be implemented in JavaScript.</p>
<p>So not use loadonce:true in your case. You can find <a href="http://stackoverflow.com/questions/5500805/asp-net-mvc-2-0-implementation-of-searching-in-jqgrid/5501644#5501644" target="_blank">here</a> for example (direct link for dowload is <a href="http://www.ok-soft-gmbh.com/jqGrid/jqGridDemo.zip" target="_blank">here</a>) ASP.NET MVC 2.0 code which is small enough and implement not only sorting and paging of data, but additionally filtering/sorting of data using advanced searching or/and toolbar searching.</p>
<p>Best regards<br />Oleg&#160;</p>
]]></description>
        	        	<pubDate>Tue, 03 May 2011 18:40:02 +0300</pubDate>
        </item>
        <item>
        	<title>miki on Stop running this script error</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/stop-running-this-script-error#p23004</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/stop-running-this-script-error#p23004</guid>
        	        	<description><![CDATA[<div id="post22942">
<p>I am using jqgrid with json format. Grid has got 20,000 rows. The grid is showing up with data. I have enabled client side sorting using the following code</p>
<p>loadonce: true, // to enable sorting on client side</p>
<p>sortable:true //to enable sorting</p>
</p>
<p>When i try to sort&#160;IE is showing the Stop Running Script dialog saying "A script on this page is causing your web browser to run slowly. If it continues to run,&#160;&#160;&#160;your computer might become unresponsive.".</p>
</p>
<p>I am using latest version of Jqgrid files. jquery-1.5.2.min.js, jquery.jqGrid.src.js, jquery.jqGrid.min.js.</p>
</p>
<p>What should I do to resolve this issue. Please help</p>
<p>Thanks</p>
<p>&#160;My view:</p>
<p>&#60;link href="../../css/custom-theme/jquery-ui-1.8.11.custom.css" rel="stylesheet" type="text/css" /&#62;<br />&#60;link href="../../css/ui.jqgrid.css" rel="stylesheet" type="text/css" /&#62;</p>
<p>&#60;script src="../../js/jquery-1.5.2.min.js" type="text/javascript"&#62;&#60;/script&#62;<br />&#60;script src="../../js/i18n/grid.locale-en.js" type="text/javascript"&#62;&#60;/script&#62;<br />@*&#60;script src="../../js/jquery.jqGrid.min.js" type="text/javascript"&#62;&#60;/script&#62;*@<br />&#60;script src="../../js/jquery.jqGrid.src.js" type="text/javascript"&#62;&#60;/script&#62;</p>
<p>&#160;&#60;table id="list2&#8243;&#62;&#60;/table&#62;<br />&#60;div id="pager2&#8243;&#62;&#60;/div&#62;</p>
<p>&#60;script type="text/javascript"&#62;<br />&#160;&#160;&#160; jQuery("#list2&#8243;).jqGrid({<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; url: &#39;/Home/GetJQGridJsonData/&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; datatype: "json",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; colNames: [&#39;AddressLine1&#39;, &#39;AddressLine2&#39;, &#39;City&#39;],<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; colModel: [<br />&#160;&#160; &#160;&#160;{ name: &#39;AddressLine1&#39;, index: &#39;AddressLine1&#39;, width: 100, sortable:true },<br />&#160;&#160; &#160;&#160;{ name: &#39;AddressLine2&#39;, index: &#39;AddressLine2&#39;, width: 100 },<br />&#160;&#160; &#160;&#160;{ name: &#39;City&#39;, index: &#39;City&#39;, width: 100 }</p>
<p>&#160;&#160; &#160;],<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; rowNum: 20,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; rowList: [10, 20, 30],<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; pager: &#39;#pager2&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; sortname: &#39;AddressLine1&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; viewrecords: true,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; sortorder: "desc",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; caption: "Pilot Information",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; width: 800,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; height: 500,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; loadonce: true, // to enable sorting on client side<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; sortable: true //to enable sorting <br />&#160;&#160;&#160; });<br />&#160;&#160;&#160; jQuery("#list2&#8243;).jqGrid(&#39;navGrid&#39;, &#39;#pager2&#39;, { edit: false, add: false, del: false });</p>
<p>&#60;/script&#62;</p>
</p>
<p>&#160;My cotroller:</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; public virtual JsonResult GetJQGridJsonData(int page, int rows, string search, string sidx, string sord)<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; {</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; List&#60;Address&#62; jqData = new List&#60;Address&#62;();<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; jqData = context.Addresses.ToList();</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; int pageIndex = Convert.ToInt32(page) &#8211; 1;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; int pageSize = rows;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; int totalRecords = jqData.Count();</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; int totalPages;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (totalRecords &#62; 0)<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; totalPages = (int)Math.Ceiling((float)totalRecords / (float)pageSize);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; else<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; totalPages = 0;</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // if for some reasons the requested page is greater than the total set the requested page to total page <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; if (page &#62; totalPages) page = totalPages;</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; //total &#8211; Total number of Pages.<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; //page &#8211; Current page Index.<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; //records &#8211; Total number of records in the rows group.<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; //rows &#8211; An array with the data plus an identifier.<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; //id &#8211; The unique row identifier, needs to be an int from what I have found.<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; //cell &#8211; An array of the data for the grid.<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; var jsonData = new JqGridJsonData<br />&#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; total = totalPages,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; page = pageIndex,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; records = totalRecords,</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; rows = jqData.Select(vm =&#62;<br />&#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; new JQGridRowJson<br />&#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; {<br />&#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; id = vm.AddressLine1,<br />&#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; cell = new[]{<br />&#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;&#160;&#160;&#160;&#160; <br />&#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;&#160;&#160;&#160;&#160;&#160;&#160;&#160; vm.AddressLine1,<br />&#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;&#160;&#160;&#160;&#160;&#160;&#160;&#160; vm.AddressLine2,<br />&#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;&#160;&#160;&#160;&#160;&#160;&#160;&#160; vm.City,<br />&#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;&#160;&#160;&#160;&#160;&#160;&#160;&#160; vm.PostalCode<br />&#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; }<br />&#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; }).ToArray()</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; };<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; return Json(jsonData, JsonRequestBehavior.AllowGet);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</p>
</div>
]]></description>
        	        	<pubDate>Tue, 03 May 2011 17:54:19 +0300</pubDate>
        </item>
</channel>
</rss>