EasyUI Forum
April 28, 2024, 03:32:21 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: Panel tool button with text  (Read 9594 times)
Fabrice
Jr. Member
**
Posts: 62


View Profile
« on: September 28, 2015, 07:40:27 AM »

How can i add text to panel tool button ?
I try this but does not work :
Code:
tools: [{
    iconCls: 'icon-add',
    text: 'Add',
    handler: function () {
        alert('add');
    }
}, {
    iconCls: 'icon-remove',
    text: 'Remove',
    handler: function () { alert('remove') }
}]
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: September 29, 2015, 12:43:49 AM »

You can not use the 'tools' property to add a text button, but you can custom the whole panel header.
Code:
<div id="p" class="easyui-panel" title="Basic Panel" style="width:430px;height:200px;">
<header>
<span style="display:inline-block;line-height:20px">title</span>
<span style="float:right;">
<a href="#" class="easyui-linkbutton" style="height:20px">textbutton</a>
</span>
</header>
</div>
Logged
iLLuSia
Newbie
*
Posts: 12


View Profile Email
« Reply #2 on: March 15, 2021, 06:31:29 PM »

Hello,

I used this code to add buttons on the title on a dialog, it works fine. But there's a little problem: I can no longer drag&drop the dialog. Is there a way to fix this?
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #3 on: March 15, 2021, 11:39:01 PM »

Please refer to the code below.
Code:
<div id="dlg" class="easyui-dialog" title="Basic Dialog" data-options="iconCls:'icon-save'" style="width:400px;height:200px;padding:10px">
<header class="f-row">
<div class="panel-title f-full">
<span style="display:inline-block;line-height:20px">title</span>
</div>
<a href="#" class="easyui-linkbutton" style="height:20px">textbutton</a>
</span>
</header>
<div>The dialog content.</div>
</div>
Code:
$(function(){
$('#dlg').data('window').window.draggable({
handle: '>.panel-header>.panel-title'
})
})
Logged
iLLuSia
Newbie
*
Posts: 12


View Profile Email
« Reply #4 on: March 17, 2021, 01:40:41 AM »

I'll be testing the code in the near future. Thank you very much!
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!