کاملاسری آن یک شبکه ای باپتانسیل Flex دریک پروژه ( روی ) من دارم کارمی کنم
فراخوانی نمایش بدهم remoting خواهدداشت که یک احتیاج بزرگ رکوردهاازیک
تااین که تجزیه وتحلیل خطرپتانسیل کارآیی ضعیف پائین جاده من تصمیم گرفتم که آن
بهترین به کش پرس وجودرنموی برگشت وسپس سازنده ام صفحه بندی ازطریق منتج می کرد
راه حل انجام دادم اماهرچیز pre – built برای یک Googling من مقداری
پرس وجوایجادکردم cached پیدانکردیم بنابراین من هدف خودم رابه گرداننده صفحه بندی
کدزیراست
هم اکنون آن درست قشنگ ،مرحله درمقصودپرس وجو،یک سطرشروع ویک سطرآخرین است
شامل یک راه اندازی پرس وجودرشناسه سطرشروع حرکت معکوس می کندوپایان struct هدف یک
( هم بولی ( مقدار hasmorerows و ) بولی ( مقدار haspreviousrows درآخرشناسه ،یک
پارومی زند
بوسیله فراخوان این هدف وفعالانه Flex پرس وجودر cached اکنون من به آسانی صفحه توسط
می توانم ‘ next / previous قادرساختن تکمه های
<cffunction name=“queryPage” access=“public” output=“false” returntype=“struct”>
<cfargument name=“theQuery” type=“query” required=“true”>
<cfargument name=“sRow” type=“numeric” required=“true” hint=“the start row of the query to return”>
<cfargument name=“eRow” type=“numeric” required=“true” hint=“the end row of the query to return”>
<cfset var returnStruct = structNew()>
<cfset var increment = arguments.eRow – arguments.sRow +1>
<cfset var returnQ = QueryNew(theQuery.columnList)>
<cfset var row = 0>
<cfset var col = “”>
<cfset returnStruct.hasPreviousRows = false>
<cfset returnStruct.hasMoreRows = false>
<cfif arguments.sRow gt arguments.eRow>
<cfthrow type=“queryPage Error” message=“Start row must be less than or equal to end row.”>
</cfif>
<cfif arguments.eRow gt theQuery.recordCount>
<cfset arguments.eRow = theQuery.recordCount>
<cfset increment = arguments.eRow – arguments.sRow +1>
</cfif>
<cfif sRow gt 1>
<cfset returnStruct.hasPreviousRows = true>
</cfif>
<cfif eRow lt theQuery.recordCount>
<cfset returnStruct.hasMoreRows = true>
</cfif>
<cfset queryAddRow(returnQ, increment)>
<cfloop query=“theQuery” startrow=“#arguments.sRow#” endrow=“#arguments.eRow#”>
<cfset row = row + 1>
<cfloop from=“1″ to=“#listLen(theQuery.columnList)#” index=“col”>
<cfset querySetCell(returnQ, listGetAt(theQuery.columnList, col, “,”), theQuery[listGetAt(theQuery.columnList, col, ",")][currentRow], row)>
</cfloop>
</cfloop>
<cfset returnStruct.theQuery = returnQ>
<cfreturn returnStruct />
</cffunction>