Modifying title column

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

Modifying title column

Postby md9 » Tue Mar 11, 2008 4:18 am

This is a small issue. I want to change the title column when record is clicked for details. I did follow the delegate class tutorial, but there is one issue.
http://xataface.com/documentation/tutor ... te_classes

The record value I am trying to put in this case is populated using value list. That is - a Name table has nameid and name. Another subscriber table has this name which is populated by valuelist, and stores nameid
Now when I say in Subscriber table delegate class
function titleColumn(){
return 'name';
}
It returns the nameid. Instead I want name to be displayed here. Do I need to put some sql stuff here??
md9
 
Posts: 9
Joined: Sat Dec 29, 2007 11:04 pm
Location: India

Postby shannah » Tue Mar 11, 2008 8:16 am

The best way to handle this is in 2 steps.

1. Using the __sql__ directive in the fields.ini file for the subscriber table, add the name field to your table.
e.g.
Code: Select all
__sql__ = "select s.*, n.name as fullName from `Subscriber` s left join `Name` n on s.name=n.nameid"


2. Reference the fullName field that we created in the titleColumn() method:
Code: Select all
function titleColumn(){
    return 'fullName';
}


-Steve
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 11 guests

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