Page 1 of 1

Adding a button next to a field

PostPosted: Tue Mar 22, 2011 9:51 am
by jay
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.

Re: Adding a button next to a field

PostPosted: Tue Mar 22, 2011 10:29 am
by shannah
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

Re: Adding a button next to a field

PostPosted: Wed Mar 23, 2011 6:10 am
by jay
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.

Re: Adding a button next to a field

PostPosted: Wed Mar 23, 2011 10:22 am
by shannah
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