Categories > TinyButStrong general >

Row Number

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Greg
Date: 2006-03-14
Time: 20:27

Row Number

In the "Groupings (header, ...)" example - is there a way to get the row number (ie. - the nth <TR> - simpliar to [blk_res.$] & [$blk_res.#]) for any given <TR>?

If I knew how many records would be under each category I could hard code it into the array - but ATM New York is the 8th <TR>, but if there was one more Washington Record - it'd be the 9th <TR> and if there was another city between Washington and New york - it'd be at least the 11th <TR>.

Any ideas? (my apologies if I'm being confuzing - it's clear in my head - but neuro implants to get thoughts to monitor haven't been developed yet).
By: TomH
Date: 2006-03-14
Time: 21:01

Re: Row Number

Not sure I get exactly what you're trying to do with the 'row number' but I would just place a counter inside an ondata function and reset on a change of category

By way of example - a code block I use to keep running totals inside categories...
function reservation_balance($BlockName,&$CurrRec,$RecNum){
global $balance; // need this so it's available for next calc ;-)
$CurrRec['memberlogin']=="Minimum" ?  $balance = $CurrRec['quantity'] : $balance=$balance - $CurrRec['quantity'];
$CurrRec['balance'] = $balance;
}
and in the html, to cycle on the categories
[blk.balance;block=footer;footergrp=resnumber]
HTH