Customizing the way the list is rendered

A place for users and developers of the Xataface to discuss and receive support.

Customizing the way the list is rendered

Postby chichi » Mon Sep 06, 2010 10:32 am

Hello, dont delete this I just have a question and clicked delete by incident.

In the documentation I found the info for customizing the way the list is rendered.

I have a table called "customers"

Code: Select all
class tables_customers {

    function renderRow( &$record ){
        return '<td>'.$record->display('name').'</td>'.
               '<td>'.$record->display('lastname').'</td>'.
               '<td>'.$record->display('online').'</td>';
    }


Result: It shows me the data the way I want it.
How can I change the output name to have a link to the EDIT-URL of the record.

I tested:
'<td><a href="???">'.$record->display('name').'</a></td>'.


chichi
chichi
 
Posts: 28
Joined: Fri Jul 09, 2010 3:05 am

Re: Customizing the way the list is rendered

Postby cantlep » Tue Sep 07, 2010 1:10 am

might this work?

Code: Select all
<td><a href="index.php?-table=customers&-action=edit&-record=customers?'.$record->strval('name').'">'.$record->display('name').'</a></td>'.


I'm not 100%, it's just a guess.
cantlep
 
Posts: 172
Joined: Fri Mar 05, 2010 2:14 am

Re: Customizing the way the list is rendered

Postby shannah » Fri Sep 17, 2010 12:25 pm

You can get the edit url for a record using the getURL() method:
Code: Select all
$record->getURL('-action=edit')
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 29 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved