<?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: Issue with scoll: 1</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/issue-with-scoll-1</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/issue-with-scoll-1/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>elitemike on Issue with scoll: 1</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/issue-with-scoll-1#p21660</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/issue-with-scoll-1#p21660</guid>
        	        	<description><![CDATA[<p>Hello all, I hope someone can help me.&#160; I have a grid with scroll set to 1 for endless scroll.&#160; occasionally it&#39;s making one final call to the webservice to grab the same final rows.&#160; When regular paging is used, this does not happen.&#160; After debugging, it is indeed making the same exact final call 2 times and appending those results.&#160; My code is below.&#160; Currently there is no sorting implemented.</p>
</p>
<p>I am wondering why there is no code snippet option on this forum.</p>
</p>
<p>Javascript</p>
<pre>function&#160;InitializeJQGridEP()<br />&#160;{<br />&#160;&#160;&#160;&#160;&#160;var&#160;AuthID&#160;=&#160;"";<br />&#160;&#160;&#160;&#160;&#160;if&#160;(CurrentAuthorized&#160;!=&#160;null)<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;AuthID&#160;=&#160;CurrentAuthorized.ID;<br />&#160;&#160;&#160;&#160;&#160;$("#EPTable").jqGrid({<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;datatype:&#160;&#39;json&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;url:&#160;URL,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;postData:&#160;{&#160;AuthorizedID:&#160;AuthID&#160;},<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;mtype:&#160;&#39;GET&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;colNames:&#160;[&#39;Item&#39;,&#160;&#39;Permission&#39;,&#160;&#39;Authorization&#39;,&#160;&#39;Set&#160;On&#39;,&#160;&#39;&#39;],<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;colModel:&#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;name:&#160;&#39;SecurableName&#39;,&#160;index:&#160;&#39;SecurableName&#39;&#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;name:&#160;&#39;PermissionName&#39;,&#160;index:&#160;&#39;PermissionName&#39;,&#160;width:&#160;220&#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;name:&#160;&#39;Authorization&#39;,&#160;index:&#160;&#39;Authorization&#39;,&#160;classes:&#160;&#39;epAuthorization&#39;&#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;name:&#160;&#39;AuthorizedName&#39;,&#160;index:&#160;&#39;AuthorizedName&#39;,&#160;Width:&#160;260&#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;name:&#160;&#39;AuthorizedID&#39;,&#160;index:&#160;&#39;AuthorizedID&#39;,&#160;width:&#160;15,&#160;classes:&#160;&#39;EP_Goto&#39;&#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;],<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;jsonReader:<br />&#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;root:&#160;function&#160;(obj)&#160;{&#160;return&#160;obj.d.rows;&#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;total:&#160;function&#160;(obj)&#160;{&#160;return&#160;obj.d.total;&#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;page:&#160;function&#160;(obj)&#160;{&#160;return&#160;obj.d.page;&#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;records:&#160;function&#160;(obj)&#160;{&#160;return&#160;obj.d.records;&#160;}<br />&#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;rowNum:&#160;12,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;scroll:&#160;1,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;gridview:&#160;true,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;pager:&#160;&#39;#EPPager&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;viewrecords:&#160;true,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;recordtext:&#160;"{2}&#160;Effective&#160;Permissions",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;loadtext:&#160;"Retrieving&#160;Effective&#160;Permissions..",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;emptyrecords:&#160;"No&#160;Effective&#160;Permissions!",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;sortname:&#160;&#39;SecurableName&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;sortorder:&#160;"asc",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;width:&#160;Width,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;height:&#160;Height,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;onSelectRow:&#160;EPRowSelected,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;loadui:&#160;&#39;block&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;altRows:&#160;true,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;altclass:&#160;"alt",<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;gridComplete:&#160;EPGridComplete<br />&#160;&#160;&#160;&#160;&#160;});<br /> <br />&#160;&#160;&#160;&#160;&#160;$("#EPTable").jqGrid(&#39;navGrid&#39;,&#160;&#39;#EPPager&#39;,<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{&#160;edit:&#160;false,&#160;add:&#160;false,&#160;del:&#160;false,&#160;refresh:&#160;false&#160;},<br />&#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;{},<br />&#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;closeOnEscape:&#160;true,&#160;multipleSearch:&#160;false,&#160;closeAfterSearch:&#160;true&#160;});<br />&#160;}<br /><br />Webservice<br /><br /></pre>
<pre>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;public&#160;jqGrid&#160;GetEffectivePermissions(int?&#160;page,&#160;int?&#160;rows,&#160;string&#160;sidx,&#160;string&#160;sord,&#160;bool?&#160;_search,&#160;string&#160;searchField,&#160;string&#160;searchString,&#160;string&#160;searchOper,&#160;string&#160;AuthorizedID)<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;string&#160;sortExpression&#160;=&#160;string.Format("{0}&#160;{1}",&#160;sidx,&#160;sord);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;List&#60;ISecurableAuthorization&#62;&#160;permissions&#160;=&#160;new&#160;List&#60;ISecurableAuthorization&#62;();&#160;;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;int&#160;TotalEntries=0;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;if&#160;(string.IsNullOrEmpty(AuthorizedID))<br />&#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;TotalEntries&#160;=&#160;permissions.Count;<br />&#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;else<br />&#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;try<br />&#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;Guid&#160;AuthID&#160;=&#160;new&#160;Guid(AuthorizedID);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;permissions&#160;=&#160;sm.GetEffectivePermissions(AuthID,&#160;rows.Value,&#160;page.Value,&#160;out&#160;TotalEntries);<br />&#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;catch&#160;(Exception&#160;e)<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;{<br /> <br />&#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;}<br /> <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;jqGrid&#160;g&#160;=&#160;new&#160;jqGrid();<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;g.total&#160;=&#160;Convert.ToString(Math.Ceiling(TotalEntries&#160;/&#160;Convert.ToDouble(rows.Value)));<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;g.page&#160;=&#160;Convert.ToString(page.Value);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;g.records&#160;=&#160;TotalEntries.ToString();<br /> <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;int&#160;Counter&#160;=&#160;0;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;foreach&#160;(ISecurableAuthorization&#160;auth&#160;in&#160;permissions)<br />&#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;Counter++;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;jqGridRowElement&#160;row&#160;=&#160;new&#160;jqGridRowElement();<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;row.id&#160;=&#160;Counter.ToString();<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;row.cell.Add(auth.SecurableName);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;row.cell.Add(auth.PermissionName);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;AuthorizationType&#160;authType&#160;=&#160;(AuthorizationType)auth.AuthorizationBits;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;row.cell.Add(authType.ToString());<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;row.cell.Add(auth.AuthorizedName);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;row.cell.Add(auth.AuthorizedID.ToString());<br /> <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;g.rows.Add(row);<br />&#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;return&#160;g;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;}</pre></p>
]]></description>
        	        	<pubDate>Thu, 13 Jan 2011 18:33:57 +0200</pubDate>
        </item>
</channel>
</rss>