titleColumn function

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

titleColumn function

Postby cantlep » Fri May 21, 2010 7:21 am

Hiya,

In my SiteData.php I have the following:

Code: Select all
function titleColumn(){
    return "concat(SiteData.SiteName , '[',SiteData.MPAN1,']')";
}

If "MPAN1" was held in another table (perhaps "MPANSTUFF" for example instead of SiteData) would the above concat still be possible (even though both items I want to display are in separate tables)?

Thanks

Paul
cantlep
 
Posts: 172
Joined: Fri Mar 05, 2010 2:14 am

Re: titleColumn function

Postby shannah » Fri May 21, 2010 8:14 am

Yes. 2 parts. First graft the field you want onto the table using the __sql__ directive of the fields.ini file. Then you'll be able to reference it from the titleColumn() method like any other column of the table.
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: titleColumn function

Postby cantlep » Fri May 21, 2010 8:23 am

Uber quick :-)

Many Thanks. I'd thought as much so that hopefully means that I'm finally getting to grips with Xtaface... Love it!
cantlep
 
Posts: 172
Joined: Fri Mar 05, 2010 2:14 am


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 21 guests

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