Changin the Current Record variable in details view

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

Changin the Current Record variable in details view

Postby meta » Mon Jun 23, 2008 9:10 am

Hi Steve, hi all,

long time ago I read somewhere in the forum that the Current Record: variable in details view always grabs and displays the first char / varchar / text field of the currently displayed record.

Is there a possibility to change this on a per table basis?

An example: I have a table with customers. It is organized like this:

cust_id (int) (autoincrement) (primary key)
firstname (varchar)
lastname (varchar)
company (varchar)
company_id (int)
[...]

Every time I see a record in details view I will see Current Record: firstname

I would more like to see Current Record: company or even Current Record: company_id

Can I change this somewhere only for that table and not for the whole app?

I am using 1.0-beta-3 now.

Thank you
Markus
meta
 
Posts: 30
Joined: Mon Nov 12, 2007 8:30 am
Location: Berlin, Germany

Postby shannah » Mon Jun 23, 2008 9:13 am

That can be done with the getTitle() method:

Code: Select all
function getTitle(&$record){
    return $record->display('company_id');
}
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby meta » Tue Jun 24, 2008 5:46 am

shannah wrote:That can be done with the getTitle() method:

Code: Select all
function getTitle(&$record){
    return $record->display('company_id');
}


Thank you very much. Works fine :)
Markus
meta
 
Posts: 30
Joined: Mon Nov 12, 2007 8:30 am
Location: Berlin, Germany


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 32 guests

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