EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: kudoof on October 24, 2013, 02:12:07 PM



Title: Show title of a collapsed layout panel
Post by: kudoof on October 24, 2013, 02:12:07 PM
The panel was initialized as collapsed='true',  but the title is not showing up in the title bar area (only empty space that does not give a clue what it might be). 
Code:
  <div data-options="region:'north', split:true" title="Edit Your information" style="height:180px" collapsed="true">

I tried the code from another thread as the following:

Code:
var p = $('#maincontainer').layout('panel','north').panel({
onCollapse:function(){
var title = $('#maincontainer').layout('panel','north').panel('options').title;  // get the north panel title
var p = $('#maincontainer').data('layout').panels['expandNorth'];  // the north expand panel
p.html('<div>'+title+'</div>');
}
});

but it did not work even after the page loaded. 


Title: Re: Show title of a collapsed layout panel
Post by: stworthy on October 24, 2013, 05:48:40 PM
Try this.
Code:
<div id="maincontainer" class="easyui-layout" style="width:800px;height:400px">
<div region="north" title="MyTitle" style="height:100px" data-options="
collapsed:true,
onCollapse:function(){
setTimeout(function(){
var p = $('#maincontainer').layout('panel','expandNorth');
p.panel('setTitle','MyTitle');
},0);
}
">
</div>
<div region="center"></div>
</div>


Title: Re: Show title of a collapsed layout panel
Post by: arma on February 03, 2014, 12:03:05 AM
Ah thanks, that works good  ;D