Page 1 of 1

renderRowHeader problem

PostPosted: Mon Mar 26, 2012 3:08 am
by Martin Pruss
Hi Steve ..
currently I am using Xataface # 1.3rc6
I'd like to style the main Table with the following function in the delegate class of that table:

Code: Select all
    function renderRowHeader( $tablename ){
        $table =& Dataface_Table::loadTable($tablename);
        $fields =& $table->fields();
        return '<th class="links" >'.$fields['id']['widget']['label'].'</th>'.
              '<th>'.$fields['datum']['widget']['label'].'</th>'.
              '<th>'.$fields['kundenname']['widget']['label'].'</th>'.
               '<th class="rechts">'.$fields['owner']['widget']['label'].'</th>';
    }


This works fine... but
now only the Table header shows ... the rest of the table is gone :(
what am I doing wrong?


cheers
Martin

Re: renderRowHeader problem

PostPosted: Mon Mar 26, 2012 9:27 am
by shannah
I can think of no reason why this would happen. Check your error log

Re: renderRowHeader problem

PostPosted: Tue Mar 27, 2012 12:56 am
by Martin Pruss
Hi Steve..
I checked the log ...error reporting is on but no entries.
The relevant parts of the Source Code of the website look like this:
Code: Select all
</tr><tr class="listing even "></tr><tr class="listing even " style="display:none" id="n_f?id=4868-row"><td colspan="1" id="n_f?id=4868-cell"></td>
                 </tr><tr class="listing odd "></tr><tr class="listing odd " style="display:none" id="n_f?id=4867-row"><td colspan="1" id="n_f?id=4867-cell"></td> etc..

Empty table rows and additionally there is the inline style : style="display:none"
I did a search on the xataface folder and the folder of my app to clarify where this line is coming from ... i found some, but none of them is related to
the rendering of a table.
Another mysterious thing is that this only happens when I override the rendering of the table header in the delegate class (description in the post above)

What else could I do to debug this?
cheers
Martin

Re: renderRowHeader problem

PostPosted: Thu Mar 29, 2012 2:44 am
by Martin Pruss
This also happens on a fresh install with latest xf version and simple app generated by installer (extended with a delegate class for the table headers ..of course)

Re: renderRowHeader problem

PostPosted: Thu Mar 29, 2012 9:55 am
by shannah
Upon looking into this problem more closely I see why this is happening. I could make some changes to make it work but, I think it is probably best, if you're going to implement the renderRowHeader() method that you also implement the renderRow() method because you need to ensure that the rows always output the same columns that the header outputs.

-Steve

Re: renderRowHeader problem

PostPosted: Wed Apr 18, 2012 3:45 am
by Martin Pruss
this works ..
Thanks
Martin