tooltips on crud forms

38 views
Skip to first unread message

Marco Prosperi

unread,
Dec 16, 2009, 3:45:45 AM12/16/09
to web2py-users
hi all, I would like to add tooltips to field labels or to controls in
a crud form to show the name of the underlying database field. I've
seen some thread about tooltips in the past but not coming to a clear
end (and maybe in the meantime something has been added to web2py to
manage this easily that I'm not aware of).

thanks in advance for hints,

Marco

mdipierro

unread,
Dec 16, 2009, 11:49:09 AM12/16/09
to web2py-users
Yes, there is a jquery tooltips plugin/

Fran

unread,
Dec 18, 2009, 10:52:14 AM12/18/09
to web2py-users
On Dec 16, 4:49 pm, mdipierro <mdipie...@cs.depaul.edu> wrote:
> Yes, there is a jquery tooltips plugin/

I use ClueTip: http://plugins.learningjquery.com/cluetip/

If you want to see an example of it's integration, I call it like
this:

Copy script to /static/scripts
In my case:
http://trac.sahanapy.org/browser/static/scripts/S3/jquery.cluetip.js

Load it in views/web2py_ajax.html
In my case:
http://trac.sahanapy.org/browser/views/sahana_scripts_min.html

jQuery('.tooltip').cluetip({activation: 'click', sticky: true,
closePosition: 'title',closeText: '<img src="/{{=request.application}}/
static/img/cross2.png" alt="close" />',splitTitle: '|'});

Then add it to fields via the 'comment' tag:
db.table.field.comment = A(SPAN("[Help]"), _class="tooltip", _title=T
("MyTitle|MyHelpText."))
An example:
http://trac.sahanapy.org/browser/models/03_media.py

F

Reply all
Reply to author
Forward
0 new messages