EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: yogesh on August 29, 2012, 02:10:46 AM



Title: panel collapse on header click
Post by: yogesh 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 ?


Title: Re: panel collapse on header click
Post by: stworthy 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);
}
});


Title: Re: panel collapse on header click
Post by: yogesh on August 29, 2012, 03:50:26 AM
good its working

but how to achieve same on the datagrid header and treegrid header


Title: Re: panel collapse on header click
Post by: stworthy 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(){
//...
});


Title: Re: panel collapse on header click
Post by: yogesh on August 30, 2012, 12:09:23 AM
thanks