Categories > TinyButStrong general >

Trouble With a Table Row

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Maz
Date: 2005-12-20
Time: 13:50

Trouble With a Table Row

Code:

<table cellspacing="1" cellpadding="5">
    <tr>
        <th></th>
        <th>Order ID</th>
        <th>Transaction ID</th>
        <th>Customer</th>
        <th>Order Date</th>
        <th>Amount Paid</th>
        <th>Order Status</th>
    </tr>
    <tr>
        <td class="light">
            <a href="#" onclick="switchDiv('[transactions.order_id]');return false;">+</a>
        </td>
        <td class="light">[transactions.order_id;block=tr;noerr]</a></td>
        <td class="light">[transactions.trans_id;block=tr;noerr]</td>
        <td class="light">[transactions.customer;block=tr;noerr]</td>
        <td class="light">[transactions.timestamp;frm='ddxx mmm yyyy hh:nn']</td>
        <td class="light">[transactions.amount]</td>
        <td class="light">[transactions.status]</td>
    </tr>
    <tr style="display: none;" id="[transactions.order_id]">
        <td class="light" colspan="7">More details to go here....</td>
    </tr>
    <tr>
        <td class="light" colspan="4">[transactions;block=tr;nodata]No Products for Download</td>
    </tr>
    <tr>
        <td class="dark">
            <a href="#" onclick="switchDiv('[transactions.order_id]');return false;">+</a>
        </td>
        <td class="dark">[transactions.order_id;block=tr;noerr]</a></td>
        <td class="dark">[transactions.trans_id;block=tr;noerr]</td>
        <td class="dark">[transactions.customer;block=tr;noerr]</td>
        <td class="dark">[transactions.timestamp;frm='ddxx mmm yyyy hh:nn']</td>
        <td class="dark">[transactions.amount]</td>
        <td class="dark">[transactions.status]</td>
    </tr>
    <tr style="display: none;" id="[transactions.order_id]">
        <td class="dark" colspan="7">More details to go here....</td>
    </tr>
</table>

Problem: I can't get the
    <tr style="display: none;" id="[transactions.order_id]">
        <td class="dark" colspan="7">More details to go here....</td>

rows to display properly. I think it's because I may need to add an "extend" in there somewhere but I can't quite fathom it.
By: Skrol29
Date: 2005-12-20
Time: 13:58

Re: Trouble With a Table Row

This is because there is no block/section definition on this <tr>. It is simply deleted since it's betweens two block sections.

You should code:
tr style="display: none;" id="[transactions.order_id;block=tr]">
  <td class="dark" colspan="7">More details to go here....</td>

By the way, you need "block=tr" in only one TBS tag inside the same <tr>.
You've put it three times.
By: Maz
Date: 2005-12-20
Time: 23:02

Re: Trouble With a Table Row

Thanks, Skrol. That doesn't seem to have solved it either. A view of the source reveals:

                    <tr>
                        <td class="light">

                            <a href="#" onclick="switchDiv('124');return false;">+</a>
                        </td>
                        <td class="light">124</a></td>
                        <td class="light">11R0610804247192G</td>
                        <td class="light">MNocifora</td>
                        <td class="light">20th Dec 2005 18:42</td>

                        <td class="light">25.00</td>
                        <td class="light">Payment Completed</td>
                    </tr><tr style="display: none;" id="120">
                          <td class="light" colspan="7">More details to go here....</td>
                    </tr>

I can see what's happening, the ID of the hidden row should be the same as as SwitchDiv (124), but as you can see, it's been assigned as 120. Any other plans?
By: Skrol29
Date: 2005-12-26
Time: 14:43

Re: Trouble With a Table Row

Hello Maz,

This is normal. For each section that you define for a block (a section is define with "block=..."), TBS will use it for alternative display. This mean each record will be displayed using a different section taken sequentially.

I you want to define one section over two <tr>, then you have to use parameter "extend".

Example :
<tr>
  ...
  [transactions.order_id;block=tr;extend=1;noerr]
  ...
</tr>
<tr style="display: none;" id="[transactions.order_id]">
  <td class="dark" colspan="7">More details to go here....</td>
</tr>