Split cfouput results

Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default Split cfouput results

    All right,

    I've got quite a big output on my page which I want to split in pages of let's
    say 10 or 20 products.
    How do I do this ? I've already sorted the products by first letter but I
    can't manage to split this output again.

    Thanks for helping

    Code:


    <cfinvoke
    component="siteje.components.product"
    method="getproducten"
    returnvariable="website">
    </cfinvoke>

    <html>
    <head>
    </head>
    <body>
    <center>
    <p align="center"><strong><a href="software.cfm?sort=0-9">0-9</a> | <a
    href="software.cfm?sort=a">A</a> | <a href="software.cfm?sort=b">B</a> | <a
    href="software.cfm?sort=c">C</a> | <a href="software.cfm?sort=d">D</a> | <a
    href="software.cfm?sort=e">E</a> | <a href="software.cfm?sort=f">F</a> | <a
    href="software.cfm?sort=g">G</a> | <a href="software.cfm?sort=h">H</a> | <a
    href="software.cfm?sort=i">I</a> | <a href="software.cfm?sort=j">J</a> | <a
    href="software.cfm?sort=k">K</a> | <a href="software.cfm?sort=l">L</a> | <a
    href="software.cfm?sort=m">M</a> | <a href="software.cfm?sort=n">N</a> | <a
    href="software.cfm?sort=o">O</a> | <a href="software.cfm?sort=p">P</a> | <a
    href="software.cfm?sort=q">Q</a> | <a href="software.cfm?sort=r">R</a> | <a
    href="software.cfm?sort=s">S</a> | <a href="software.cfm?sort=t">T</a> | <a
    href="software.cfm?sort=u">U</a> | <a href="software.cfm?sort=v">V</a> | <a
    href="software.cfm?sort=w">W</a> | <a href="software.cfm?sort=x">X</a> | <a
    href="software.cfm?sort=y">Y</a> | <a
    href="software.cfm?sort=z">Z</a></strong></p><BR>

    <table width="550" border="1" cellpadding="15" cellspacing="0">
    <cfoutput query="website">
    <cfif website.currentrow mod 2 eq 1>
    <tr>
    </cfif>
    <td valign="top" align="center" width="100">
    <a href="detail.cfm?recordid=#website.link#"><img
    src="webpictures/#webpicture1#" border="0"></a>
    </td>
    <td> <B><a href="detail.cfm?recordid=#website.link#"
    class="style2">#productgroep# ></a></B>
    <BR><BR>
    #webomschrijving_NL_kort#<BR>

    <!--- //Niet aanwezig
    Ontwikkelaar: #website.ontwikkela#<br> --->

    <div align="right">Prijs: #LSEuroCurrencyFormat(website.SRP_EUR)#</div><BR>
    <cfif IsBoolean(website.grootte_macdemo)>
    <a href="#website.ftp_macdemo_calc#">Demo Mac</a> - #website.Grootte_macdemo#
    kb<BR>
    </cfif>

    <cfif IsBoolean(website.grootte_windemo)>
    <a href="#website.ftp_windemo_calc#">Demo Win</a> - #website.Grootte_windemo#
    kb
    </cfif>
    <HR>
    <div align="right">
    </div></td>
    <cfif website.currentrow mod 2 eq 1>
    <tr>
    </cfif>
    </cfoutput>
    </table>
    </center>
    </body>
    </html>

    Funkert Guest

  2. Similar Questions and Discussions

    1. formatting find results in results window or in savedfile
      I want a :beer; :-). I want to write an extension that will allow me to format the results returned from a find. I couldn't find anything in...
    2. Complex join = no results (for a query that shouldreturn results)
      I am trying to use a rather complex join that returns many results when the SQL server is queried directly, but returns no results when used on a...
    3. Sending search results to a results page..with asp
      Please help.. very :confused; Ive setup 4 dynamic drop down boxes which populate themselves from my database, this all works fine..The last box...
    4. Query results don't display properly in results table.IGNORE PREVIOUS
      :disgust; I need to display the results of a query. The query runs properly. My problem is having specific results display in specific locations in...
    5. Query results don't display properly in results table.
      :disgust; I need to display the results of a query. The query runs properly. My problem is having specific results display in specific locations in...
  3. #2

    Default Re: Split cfouput results

    The CFQUERY tag has STARTROW and MAXROW attributes that can be used to limit
    the number of items displayed. The trick is to initially set a variable,
    let's call it start, to 1 and use it as the value for STARTROW. Then
    increment start by MAXROW, and use this in the "Next" link that reloads the
    page (start=#start#). When the page reloads, the new value for start will be
    used. Your "Previous" link can be handled in the same way. And look out for
    end conditions - you don't want start to get bigger than your recordCount nor
    less than 0.

    jdeline Guest

  4. #3

    Default Re: Split cfouput results

    Ah, thanks for helping. Sometimes the solution is so simple :)

    I'll try this.
    Funkert Guest

  5. #4

    Default Re: Split cfouput results

    OK, it works fine. But now this, I also made a filter to select products by
    first letter, and this doesn't work in combination with the startrow/maxrow
    thingy. I've tried several ways to combine them, without succeeding..

    Funkert Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139