EasyUI Forum
September 13, 2025, 09:22:58 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: How to add tooltip for the icon of a combobox  (Read 9036 times)
JohnWang
Newbie
*
Posts: 5


View Profile
« on: December 05, 2014, 08:22:30 PM »

Dear admins,
How to add tooltip for the icon of a combobox? I want to add "selectAll" and "unSelectAll" as tooltips, but it doesn't work.
My source code is like this:

Code:
<input id="alarmType" name="alarmType" class="easyui-combobox"
data-options="panelHeight:'250', editable:true, valueField:'value', textField:'text', multiple:true,
icons:[{
        iconCls:'icon-ok', id: 'alarmTypeSelectAll',
        handler:function(e){
          var c = $(e.data.target);
          var opts = c.combobox('options');
          var index = opts.valueField;
          $.map(c.combobox('getData'), function(row){
            c.combobox('select', row[index]);
          })
        }
      },{
        iconCls:'icon-clear', id: 'alarmTypeUnSelectAll',
        handler:function(e){
          var c = $(e.data.target);
          var opts = c.combobox('options');
          $.map(c.combobox('getData'), function(row){
            c.combobox('unselect', row[opts.valueField])
          })
        }
      }]"/>


Code:
$("#alarmTypeSelectAll").tooltip({position:'left', content: 'selectAll'});
$("#alarmTypeUnSelectAll").tooltip({content: 'unSelectAll'});
Logged
jarry
Administrator
Hero Member
*****
Posts: 2298


View Profile Email
« Reply #1 on: December 06, 2014, 06:03:53 AM »

The icon does not accept the 'id' property, but you can call 'getIcon' method instead to get the specified icon and apply the tooltip on it.
Code:
$('#alarmType').textbox('getIcon',0).tooltip({position:'left', content: 'selectAll'});
$('#alarmType').textbox('getIcon',1).tooltip({content: 'unSelectAll'});
Logged
JohnWang
Newbie
*
Posts: 5


View Profile
« Reply #2 on: December 06, 2014, 06:38:52 AM »

Thank you,Jarry! It works!
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!