EasyUI Forum
May 16, 2024, 04:22:00 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: Event handler of Panel icon  (Read 15427 times)
Xiaolin
Newbie
*
Posts: 14


View Profile Email
« on: November 22, 2011, 02:30:09 AM »

We can show a icon on the Panel title bar by setting the iconCls property, can we set an event handler for the icon, which will be fired when clicking on the icon? Or can we add some buttons with handler to the Panel title bar?
Logged
tslatt
Jr. Member
**
Posts: 85



View Profile
« Reply #1 on: November 22, 2011, 09:21:57 AM »

I was going to refer you to the 'Documentation' section of the website, where there is an example of how to do this for a panel. However, I tried to implement the example and it didn't work at all. It's possible I just did something wrong, though. You should take a look and see if it helps you.

Code:
$('#p').panel({  
  width:500, 
  height:150, 
  title: 'My Panel', 
  tools: [{ 
    iconCls:'icon-add', 
    handler:function(){alert('new')} 
  },{ 
    iconCls:'icon-save' 
    handler:function(){alert('save')} 
  }] 
});   

Logged
Xiaolin
Newbie
*
Posts: 14


View Profile Email
« Reply #2 on: November 22, 2011, 09:31:42 PM »

Thanks tslatt. In fact, the example is trying to add 2 buttons to the Panel toolbar, not the title bar.
Logged
alex.capurro
Newbie
*
Posts: 25


View Profile Email
« Reply #3 on: December 23, 2011, 01:44:25 AM »

I would like to know the same thing..
Logged
alex.capurro
Newbie
*
Posts: 25


View Profile Email
« Reply #4 on: December 23, 2011, 01:51:47 AM »

actually the code is exactly what i needed thanks!
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!