easyui datagrid tooltip

 1 $('#dg').datagrid('getPanel').find('.easyui-tooltip').each(function(){
 2         var index = parseInt($(this).attr('data-p1'));
 3         $(this).tooltip({
 4             content: $('<div></div>'),
 5             onUpdate: function(cc){
 6                 var row = $('#dg').datagrid('getRows')[index];
 7                 var content = '<div>content</div><ul>';
 8                 content += '<li>name: '+row.A+'</li>';
 9                 content += '<li>B: '+row.B+'</li>';
10                 content += '<li>C: '+row.C+'</li>';
11                 content += '<li>D: '+row.D+'</li>';
12                 content += '</ul>';
13                 cc.panel({
14                     width:200,
15                     content:content
16                 });
17             },
18             position:'right'
19         });
20     });

 

转自 : http://jsfiddle.net/F4sEX/

posted @ 2013-07-19 00:33  少爵  阅读(6996)  评论(1编辑  收藏  举报