EasyUI Forum
December 16, 2025, 04:08:25 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: panel collapse on header click  (Read 20861 times)
yogesh
Newbie
*
Posts: 47


View Profile Email
« on: August 29, 2012, 02:10:46 AM »

i am able to collapse panel using button by setting collapsible button

but if i want to collapse the panel on the header clicks how to do that is there any property which i need to set ?
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: August 29, 2012, 03:01:55 AM »

Try the following code:
Code:
var p = $('#p');
p.panel('header').click(function(){
if (p.panel('options').collapsed){
p.panel('expand',true);
} else {
p.panel('collapse',true);
}
});
Logged
yogesh
Newbie
*
Posts: 47


View Profile Email
« Reply #2 on: August 29, 2012, 03:50:26 AM »

good its working

but how to achieve same on the datagrid header and treegrid header
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #3 on: August 29, 2012, 05:06:54 AM »

The key task is to get datagrid panel, the code below shows how to do this.

var p = $('#dg').datagrid('getPanel');
p.panel('header').click(function(){
//...
});
Logged
yogesh
Newbie
*
Posts: 47


View Profile Email
« Reply #4 on: August 30, 2012, 12:09:23 AM »

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!