By: François
Date: 2005-11-29
Time: 15:23
|
Parent Group #?
I'm using the parentgrp function to split a list of results according to a column.
But I would like to display also the number of items in each groups.
A bit like this:
Group 1 3 items
-blabla
-blabla
-blbla
Group 2 2 items
-blabla
-blabla
I can't find a way to do this simply, is there any solution? Thanks in advance!
|
By: François
Date: 2005-11-29
Time: 17:25
|
Re: Parent Group #?
Hi Skrol29. Thanks for your fast answer.
I have applied your solution with success.
For those wondering about the onformat custom function, here is my code:
$nb_items=0;
function display_nb($Fieldname,&$Currval)
{
global $nb_items;
$Currval=$Currval-$nb_items;
$nb_items=$Currval;
}
I simply declare a global var "nb_items", where I save the current item number. I place the [block.#;onformat=display_nb] as the footer of my block, it displays the number of items of my first group, save the value, then for each new group, display the total number of items - the saved nb_items value.
|