EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: Fabrice on September 28, 2015, 07:40:27 AM



Title: Panel tool button with text
Post by: Fabrice 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') }
}]


Title: Re: Panel tool button with text
Post by: stworthy 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>


Title: Re: Panel tool button with text
Post by: iLLuSia 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?


Title: Re: Panel tool button with text
Post by: stworthy 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'
})
})


Title: Re: Panel tool button with text
Post by: iLLuSia on March 17, 2021, 01:40:41 AM
I'll be testing the code in the near future. Thank you very much!