I use jqGrid for my project using following server side code for ColdFusion in my cfc file.
The jqGrid works only for a few pages.
I can scroll for a couple of page using jqGrid pager.
It seems that the page and records information does not send to jqGrid correctly.
Do I need to particular to pass any row, pages and records information from client to make server response correct pages?
Your help and information is great appreciated,
Regards,
Iccsi,
<cffunction name="ccdClaimsLookup" access="remote" returnformat="json">
<cfargument name ="StartDate" required="no" default="">
<cfargument name ="EndDate" required="no" default="">
<cfargument name="page" required="no" default="1">
<cfargument name="rows" required="no" default="10">
<cfargument name="sidx" required="no" default="">
<cfargument name="sord" required="no" default="ASC">
<cfset var Mydata = ArrayNew(1)>
<cfset start = ((arguments.page-1)*arguments.rows)+1>
<cfset end = (start-1) + arguments.rows>
<cfset i = 1>
<cfstoredproc procedure="MySP">
<cfprocparam value = "#StartDate#" CFSQLTYPE = "cf_sql_date">
<cfprocparam value = "#EndDate#" CFSQLTYPE = "cf_sql_date">
<cfprocresult name="spname" resultset="1">
</cfstoredproc>
<cfloop query="spname" startrow="#start#" endrow="#end#">
<cfset Mydata[i] = [#MyID#,#MyName#,#MyDate#,#MyNote#]>
<cfset i = i + 1>
</cfloop>
<cfset totalPages = Ceiling(spname.recordcount/arguments.rows)>
<cfset stcReturn = {total=#totalPages#,page=#Arguments.page#,records=#spname.recordcount #,rows=#Mydata#}>
<cfreturn #serializeJSON(stcReturn, True)#>
</cffunction>