Modifying title column

Archived from the Xataface Users forum.

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??


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"
  1. Reference the fullName field that we created in the titleColumn() method:
Code: Select all
function titleColumn(){     return 'fullName'; }

-Steve