titleColumn function

Archived from the Xataface Users forum.

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


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.


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!