EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: smz440 on March 28, 2018, 08:06:07 PM



Title: How to reset collapsedContent when collapse
Post by: smz440 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;
}

         },


Title: Re: How to reset collapsedContent when collapse
Post by: stworthy 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>


Title: Re: How to reset collapsedContent when collapse
Post by: smz440 on March 29, 2018, 05:07:13 PM
Thanks a lot.
I am now out of office. So, try later.

Arigatou gozaimasu! :)


Title: Re: How to reset collapsedContent when collapse
Post by: smz440 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