Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Remove Data Cfloop

New Here ,
Dec 02, 2010 Dec 02, 2010

Hi, I've been having some trouble paginating some data from a Solr result... I've already manage to do so, but the problem is that in some cases the results paginate with more then 250 pages... so for that I made a condition and it goes well... the thing is that I want to remove the first value the loop outputs

This is the code:

<cfscript>
    totalpag = ceiling(meta.found / max);
    mystart = ((url.start * max) - max) +1;
    </cfscript>
       
    <cfif totalpag gt 1>
    <cfoutput>
    <cfset numstart= 1>
      
    <cfloop index="p" from="1" to="#totalpag#">
      
    <a href="results.cfm?start=#numstart#&search=#urlEncodedFormat(form.search)#&collection=#urlEncodedFormat(form.collection)#">#p#</a>
    <cfset numstart = numstart +10 >
   
    
  <cfif p gt ceiling((url.start / 10 ) + 4)>
   <cfbreak> 
  </cfif>
 
 
    </cfloop>
    </cfoutput>
    </cfif>

what I want is to delete the first values depending on this condition

<cfif p gt ceiling((url.start / 10 ) + 4)>
    <cfbreak> 
   </cfif>

I'll appreciate all the help I can get

276
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 02, 2010 Dec 02, 2010
LATEST

Basically:

I have a loop that goes from 1 to n

     <cfloop index="p" from="1" to="#totalpag#">

     </cfloop>

What I'm trying to do is that when is meets certain condition, some sort of way to remove, delete, purge, eliminate the first records the loop outputs...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources