odd table behavior

28 views
Skip to first unread message

tom wible

unread,
Feb 20, 2024, 5:03:08 PMFeb 20
to Xataface
i'm calculating the total of the result set in my transactions.php:

function renderRowFooterTemplate()
    {
        $resultSet = Dataface_Application::getInstance()->getResultSet();
        $totals = $resultSet->loadTotals(array('Amount#sum'));
        return '<tr class="template">'
               .'<th class="label" colspan=4 >Total</th>'
               .'<td data-column="Amount"> $'
                  .df_escape($totals['Amount_SUM'])
               .'</td></tr>';
    }

but the row gets mangled somewhat:

<tfoot style="">
<tr><th colspan="6">Total</th><td data-column="Amount"> $2588.72</td><td></td></tr></tfoot>

the th colspan=6 pushes the total 1 column to the right of the transaction column...howdat happen?-) i assume the value of 6 comes from the # of field columns, or maybe the amount column#+1, but is there any documentation on this?

Steve Hannah

unread,
Feb 20, 2024, 5:56:50 PMFeb 20
to xata...@googlegroups.com
This is the code that does the mangling:
https://github.com/shannah/xataface/blob/a0496b31b0a4854ab560581cea0661a7290c70a6/js/list.js#L38-L43

Not sure exactly what it's tripping on there, but you might be able to reason through it if you step through it.



--
You received this message because you are subscribed to the Google Groups "Xataface" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xataface+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/xataface/b382343e-d185-4d4c-9a6d-e838aad7e34fn%40googlegroups.com.


--
Steve Hannah
Web Lite Solutions Corp.

tom wible

unread,
Feb 21, 2024, 11:15:11 AMFeb 21
to Xataface
thanx, steve, i'll look into it...i forget where i found the renderRowFooterTemplate code...any dox on templating?

Steve Hannah

unread,
Feb 21, 2024, 2:00:37 PMFeb 21
to xata...@googlegroups.com
This is where most of those are listed:

I'm in the slow process of migrating documentation into the definitive guide.

On Wed, Feb 21, 2024 at 8:15 AM 'tom wible' via Xataface <xata...@googlegroups.com> wrote:
thanx, steve, i'll look into it...i forget where i found the renderRowFooterTemplate code...any dox on templating?

--
You received this message because you are subscribed to the Google Groups "Xataface" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xataface+u...@googlegroups.com.

tom wible

unread,
Feb 23, 2024, 10:58:43 AMFeb 23
to Xataface
trying different combinations in my renderRowFooterTemplate,  i see that an extra <td> is injected before the actual content <td>, either duplicating the payload:

        return '<tr class="template">'
               .'<td class="label" style="text-align:end;" data-column="Amount" >Total $'

                  .df_escape($totals['Amount_SUM'])
               .'</td></tr>';

generates

<tr>
<th colspan="6">Total $4357.94</th>
<td class="label" style="text-align:end;" data-column="Amount">Total $4357.94</td>
<td></td>
</tr>

or without class=label:

<tr>
<td colspan="6"></td>
<td style="text-align:end;" data-column="Amount">Total $4357.94</td>
<td></td>
</tr>

perusing the code, i haven't quite figured out how the tags are closed (now i remember why i didn't like jquery;-) but imma give 
+39:                 numLeadingBlanks -= 1;            
 a try...

tom wible

unread,
Feb 23, 2024, 11:26:36 AMFeb 23
to Xataface
it worx4me, ymmv;-) https://github.com/shannah/xataface/pull/132

sorry, haven't tried any other use cases...


tom wible

unread,
Feb 23, 2024, 11:48:37 AMFeb 23
to Xataface
> But I don't see that one there.

i would like to add a total to a related list , andi see
 "renderRowHeader    Overrides the html used for the header in a list."    
and   
"renderRelatedRowHeader    Overrides the html used for the header in a related list. "

but no renderRelatedRowFooter or ...Template

> I'm in the slow process of migrating documentation into the definitive guide.

u need 2 crowdsource it-)

Steve Hannah

unread,
Feb 24, 2024, 1:54:15 PMFeb 24
to xata...@googlegroups.com
Thanks for the PR.  It has been years since I touched that code, and I can't recall why it needed the extra space.  In your use-case does your table have a checkbox in the left-most column?  Perhaps it needed to add an extra cell to account for the checkbox that appears in tables that allow you to select multiple rows with checkbox.

On Fri, Feb 23, 2024 at 8:26 AM 'tom wible' via Xataface <xata...@googlegroups.com> wrote:
it worx4me, ymmv;-) https://github.com/shannah/xataface/pull/132

sorry, haven't tried any other use cases...


--
You received this message because you are subscribed to the Google Groups "Xataface" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xataface+u...@googlegroups.com.

Steve Hannah

unread,
Feb 24, 2024, 1:57:54 PMFeb 24
to xata...@googlegroups.com
i would like to add a total to a related list , andi see
 "renderRowHeader    Overrides the html used for the header in a list."    
and   
"renderRelatedRowHeader    Overrides the html used for the header in a related list. "
but no renderRelatedRowFooter or ...Template

I'm having trouble finding renderRelatedRowHeader in the source right now.  Either it was removed by accident, or I added them to the docs in error.

--
You received this message because you are subscribed to the Google Groups "Xataface" group.
To unsubscribe from this group and stop receiving emails from it, send an email to xataface+u...@googlegroups.com.

tom wible

unread,
Mar 1, 2024, 9:23:20 AMMar 1
to Xataface
well, i can sympathize...dox/code is a geometric if not exponential ratio:-\ 
Reply all
Reply to author
Forward
0 new messages