Adding a button next to a field

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

Adding a button next to a field

Postby jay » Tue Mar 22, 2011 9:51 am

Hi there.

I have a table with a column that will store IDs to records in another database. My idea is showing the ID field (that's no problem) and placing a button or a link next to it so that I could open a new window and select/return the ID of the selected record from there, but I cannot find a way to place an action for a field. Adding a link to the field is not suitable because it gets opened in the same tab/window as the edit form, so it gets lost.

Any advice on this? I'm now using an onclick handler in the text edit, but it's not to polite...

Regards,
J.
jay
 
Posts: 13
Joined: Wed Apr 01, 2009 3:39 am

Re: Adding a button next to a field

Postby shannah » Tue Mar 22, 2011 10:29 am

A couple of ways:

1. Include a javascript anywhere (doesn't need to be next to the field), and then use the DOM to add your button next to your field. jQuery makes this pretty easy.

2. Use the after_widget block to add a button/javascript to your field.

(If you want to see what blocks or slots are available to be filled in you can always set debug=1 at the beginning of your conf.ini file and it will show you all the available blocks and slots)

-Steve
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: Adding a button next to a field

Postby jay » Wed Mar 23, 2011 6:10 am

I used the after_widget approach, working flawlessly as usual :)
Thanks a lot.

BTW, I was unable to find any documentation in that regard, maybe I'm looking the wrong places... is it documented anywhere?

J.
jay
 
Posts: 13
Joined: Wed Apr 01, 2009 3:39 am

Re: Adding a button next to a field

Postby shannah » Wed Mar 23, 2011 10:22 am

Blocks and slots are covered in the documentation for customizing the user interface or look and feel.
e.g.
http://xataface.com/documentation/tutor ... k-and-feel
http://xataface.com/documentation/tutor ... ustomizing
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 19 guests

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