EasyUI Forum

General Category => General Discussion => Topic started by: aswzen on November 30, 2014, 08:47:30 PM



Title: Add custom tools to an easyui layout in similar way like panel
Post by: aswzen on November 30, 2014, 08:47:30 PM
I think it will be great if user can add custom tools to an easyui layout in similar way like panel..

I know layout was extended from panels plugin but i just don't know how to achieve it in more efficient way than putting
Code:
 var p = $('#container').layout('panel','North');
      var tools = p.panel('options').tools;
      p.panel({
          tools: [{
              iconCls:'icon-search',
              handler:function(){openSearch()}
          }].concat(tools.pop())
      })

regards,
sigit


Title: Re: Add custom tools to an easyui layout in similar way like panel
Post by: jarry on December 01, 2014, 03:14:58 AM
The code below shows another way to attach tools to the west panel.
Code:
  <div class="easyui-layout" style="width:700px;height:350px;">
    <div data-options="region:'west',split:true,tools:'#t1'" title="West" style="width:200px;"></div>
    <div data-options="region:'center',title:'Main Title',iconCls:'icon-ok'">
    </div>
  </div>
  <div id="t1">
    <a href="#" class="icon-add"></a>
    <a href="#" class="icon-save"></a>
  </div>