If you benefit from web2py hope you feel encouraged to pay it forward by contributing back to society in whatever form you choose!


  • 0
    javi  10 years ago

    Great tip,  but for me the comment of kmouts is a nice solution, i hacked it to make it appear the help icon in the same col of label and aligned to right:

     

    <script type="text/javascript">
        $(function() {
            $("td.w2p_fc").each(function() {
                var comment = $(this).html();
                var trl = this.parentNode.firstChild;
                if (comment) {
                    var text = $(trl).html;
                    $(this).html('');
                    $(trl).append('&nbsp;<i class="icon info icon-info-sign pull-right"></i>');
                    $(trl).children('i').attr('title', comment);
                    $(trl).children('i').tooltip({
                        placement : 'top',
                        html : true,
                        trigger : 'click'
                    });
                }
            });
        });
    </script>

Commented on:

Shows tooltips in forms created via CRUD or SQLFORM with the field´s comment attribute.

Hosting graciously provided by:
Python Anywhere