Note that there are some explanatory texts on larger screens.

plurals
  1. POasp.net ListView or Repeater grouping by three
    primarykey
    data
    text
    <p>I am using a nice shopping cart I found online. I would like to translate this code to use a repeater or listview and dynamically retrieve my data, but I cannot seem to find a way to group my data correctly. </p> <p>I know the ListView can group by a certain amount of items, but I have not found a way to do it with this scenario.</p> <p>The shopping cart works by having a ul list of items, followed by their details in the div below. This process starts again by getting three more ul items, followed by three more details. How could I do this using a ListView or repeater? I have not found a way to repeat both of these sets of data I need in a group of three. Any thoughts?</p> <pre><code> &lt;ul&gt; &lt;li id="1"&gt; &lt;div&gt;Red Grocery Bag&lt;/div&gt; &lt;/li&gt; &lt;li id="2"&gt; &lt;div&gt;Reusable Grocery Bag&lt;/div&gt; &lt;/li&gt; &lt;li id="3"&gt; &lt;div&gt;White Grocery Bag&lt;/div&gt; &lt;/li&gt; &lt;/ul&gt; &lt;div class="detail-view" id="detail-1"&gt; &lt;div class="detail_info"&gt; &lt;label class='item_name'&gt;Red Grocery Bag&lt;/label&gt; &lt;p&gt; shopping bag, shopping, bag, merchandise, consumerism, gift: &lt;br /&gt;&lt;br/&gt; $&lt;span class="price"&gt;80.00&lt;/span&gt; &lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="detail-view" id="detail-2"&gt; &lt;div class="detail_info"&gt; &lt;label class='item_name'&gt;Reusable Grocery Bag&lt;/label&gt; &lt;p&gt; shopping bag, shopping, bag, merchandise, consumerism, gift: &lt;br /&gt;&lt;br /&gt; $&lt;span class="price"&gt;70.00&lt;/span&gt; &lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="detail-view" id="detail-3"&gt; &lt;div class="detail_info"&gt; &lt;label class='item_name'&gt;White Grocery Bag&lt;/label&gt; &lt;p&gt; shopping bag, shopping, bag, merchandise, consumerism, gift: &lt;br /&gt;&lt;br /&gt; $&lt;span class="price"&gt;50.00&lt;/span&gt; &lt;/p&gt; &lt;/div&gt; &lt;/div&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload