EasyUI Forum
April 28, 2024, 05:13:43 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Add custom tools to an easyui layout in similar way like panel  (Read 10806 times)
aswzen
Sr. Member
****
Posts: 287


Indonesian

aswzen
View Profile WWW Email
« 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
« Last Edit: November 30, 2014, 10:15:58 PM by aswzen » Logged

Regards,
Sigit

- Indonesian jEasyUI Facebook page : https://www.facebook.com/groups/jeasyuiid/
jarry
Administrator
Hero Member
*****
Posts: 2262


View Profile Email
« Reply #1 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>
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!