Skip to main content
Participating Frequently
December 2, 2010
Question

Remove Data Cfloop

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

    Ce sujet a été fermé aux réponses.

    1 commentaire

    IxDelgaAuteur
    Participating Frequently
    December 2, 2010

    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...