Action based on field content (URL)

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

Postby pwg » Mon Apr 23, 2007 9:07 pm

Hi Steve,

I have a field that displays a rather long and complex URL that I would like to make 'live'. That is, when the user clicks the link it does not take her/him to a 'view' of the record but to the URL to which the link points.

I'm unable to figure this out from the current documentation on 'actions' (unless it isn't an 'action').

Can you give me some hints please?
pwg
 
Posts: 21
Joined: Wed Dec 31, 1969 5:00 pm

Postby shannah » Mon Apr 23, 2007 10:04 pm

Hi Peter,

In the next version of dataface there is a delegate class method called %fieldname%__renderCell() that allows you to output custom content to be displayed in the list view for a certain field.


For the current version there is no way to do this in list view other than to do a custom list view (or to do a little javascript magic), which is a bit of overkill for this one thing.


You can, however, make the url like in the view tab but implementing the %fieldname%__htmlValue() method.
e.g.
function myfield__htmlValue(&$record){
ÊÊÊ return ''.$record->val('myfield').'';
}
The new version will be out soon... just working out a few minor details and docs for it.
Best regards
Steve
--
Steve Hannah
@shannah78 (on twitter)
sjhannah.com blog
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby pwg » Tue Apr 24, 2007 1:57 pm

Thank you, Steve. Very helpful. Looking forward to the next version.

Best

Peter
pwg
 
Posts: 21
Joined: Wed Dec 31, 1969 5:00 pm


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 31 guests

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