melane
Newbie
Posts: 14
|
|
« Reply #3 on: July 16, 2013, 04:12:56 AM » |
|
Just to add some specificities, my tooltip is quite long and shows a liste of additional values, so I want to format them nicely and show them in a panel, just like what you show on your demo of the AJAX tooltip, except that instead of loading the tooltip content from an url, I want to programmatically set it up. I must have messed up, because whenever I set <div> <ul><li>content1</li><li>....</ul></div> to my tooltip, it does not show anything in the tooltip..
What I am currently doing is the following: In the cell formatter : column = {field:property,title:property,width:100,sortable:true,formatter:function(value,row,index){ ... return '<div data-p1='+index+' data-p2='+gridName+' data-p3='+tooltipProperty+' class=\"easyui-tooltip\" >' + value + '</div>'; }
then upon datagrid loading: $('#dg).datagrid('getPanel').find('.easyui-tooltip').each(function() {
var index = $(this)[0].getAttribute('data-p1'); var gridName= $(this)[0].getAttribute('data-p2'); var property= $(this)[0].getAttribute('data-p3'); var tooltipExtendedContent= getContent(index,gridName,columnName); $(this).tooltip({ content: $('<div></div>'), onShow: function(){ $(this).tooltip('arrow').css('left', 20); $(this).tooltip('tip').css('left', $(this).offset().left); }, onUpdate: function(cc){ cc.panel({ width: 500, height: 'auto', border: false, content:tooltipExtendedContent });}, // showDelay: 500, position: 'right' }); });
But that does not work.. not sure why, is this the correct way to do this ?
Thanks
|