EasyUI Forum
May 09, 2024, 04:19:45 AM *
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 reset collapsedContent when collapse  (Read 3380 times)
smz440
Newbie
*
Posts: 7


View Profile
« on: March 28, 2018, 08:06:07 PM »

My Layout panel has accordion.
I want to set collapsedContent as current selected accordion title.

I think CollapsedContent may be set when first collased time only.
How can i reset collapsedContent dynamically each time collapsed?

* Sorry, poor english.

Sample code;
collapsedContent: function(title){
  var region = $(this).panel('options').region;
  if (region == 'west'){
    var accordion_title = $('#accordion_menus').accordion('getSelected').panel('options').title;
    return title+' - '+new Date()+'-'+accordion_title+'</div>';
  } else {
    return title;
}

         },
« Last Edit: March 28, 2018, 08:12:16 PM by smz440 » Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: March 29, 2018, 07:38:10 AM »

Please try this example:
Code:
<div id="cc" class="easyui-layout" style="width:700px;height:350px;">
  <div title="West" style="width:100px;" data-options="
      region:'west',split:true,
      hideCollapsedContent: false,
      onCollapse: function(){
        var title = $('#aa').accordion('getSelected').panel('options').title;
        $('#titlebar').html(title)
      },
      collapsedContent: function(){
        return $('#titlebar');
      }
      ">
    <div id="aa" class="easyui-accordion" fit="true">
      <div title="Panel1"></div>
      <div title="Panel2"></div>
      <div title="Panel3"></div>
    </div>
  </div>
  <div data-options="region:'center',title:'Main Title'">
  </div>
</div>
<div id="titlebar" class="panel-title layout-expand-title layout-expand-title-down"></div>
Logged
smz440
Newbie
*
Posts: 7


View Profile
« Reply #2 on: March 29, 2018, 05:07:13 PM »

Thanks a lot.
I am now out of office. So, try later.

Arigatou gozaimasu! Smiley
Logged
smz440
Newbie
*
Posts: 7


View Profile
« Reply #3 on: March 29, 2018, 10:18:37 PM »

Stworthy

Thank you very much!
I tried and it works perfect!

It is just what I expected.

Thank you quick and perfect advice!

- smz440
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!