EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: mzeddd on March 21, 2016, 07:25:57 AM



Title: header panel in Layout
Post by: mzeddd on March 21, 2016, 07:25:57 AM
How can I make toolbar in layout to look like in dialog?

I mean I don't want to have buttons on top-right in "blue" area/header. I would like to have fixed "grey" panel below "blue" header.

Thanks,
/V


Title: Re: header panel in Layout
Post by: stworthy on March 21, 2016, 09:07:14 AM
You can put a dialog inside the region panel.
Code:
<div class="easyui-layout" style="width:700px;height:350px;">
<div style="position:relative;width:300px" data-options="
title:'west',
region:'west',
split:true
">
<div class="easyui-dialog" data-options="
inline:true,
fit:true,
shadow:false,
noheader:true,
border:false,
toolbar:[{
text:'Add'
},{
text:'Edit'
}]
">
<p>content</p>
<p>content</p>
<p>content</p>
<p>content</p>
<p>content</p>
<p>content</p>
<p>content</p>
</div>
</div>
<div data-options="region:'center'">
</div>
</div>


Title: Re: header panel in Layout
Post by: mzeddd on March 22, 2016, 01:46:15 AM
It works but not completly correct.

1) Title of the layout panel should not be closed by Dialog. In this setup I do not see "collapse" button for my "east" panel.

2) There is a gap between dialog and bottom of "east" panel of the same size as title bar or "east" panel.

Code:
<div class="easyui-layout"  style="height:240px">
<div data-options="region:'center'" title="">test</div>
<div data-options="region:'east',title:'Editor',split:true,collapsed:false" style="width:200px">
<div class="easyui-dialog" data-options="inline:true,fit:true,shadow:false,noheader:true,border:false,
toolbar:[{text:'Add'},{text:'Edit'}]">

<form id="form">
<p><b>test:</b>
<input id="test" name="tcName" class="easyui-textbox" style="width:100%" disabled>
        <p>test</p><p>test</p><p>test</p><p>test</p>
        <p>test</p><p>test</p><p>test</p><p>test</p>
        <p>test</p><p>test</p><p>test</p><p>test</p>
        <p>test</p><p>test</p><p>test</p><p>test</p>
</form>
</div>
</div>
</div>


Title: Re: header panel in Layout
Post by: stworthy on March 22, 2016, 07:29:37 AM
Please be careful to add 'position:relative' style to the east panel.
Code:
<div data-options="region:'east',title:'Editor',split:true,collapsed:false" style="width:200px;position:relative">
...
</div>

For more information please refer to http://jsfiddle.net/k0o6afhL/1/


Title: Re: header panel in Layout
Post by: mzeddd on March 23, 2016, 12:58:34 AM
Yes, got it.

Initially I put it into "data-options" section by mistake what gave me strange result and I removed it.

Now it looks as expected.

Thanks


Title: Re: header panel in Layout
Post by: mzeddd on April 04, 2016, 02:32:54 AM
Hi,

One comment to http://jsfiddle.net/k0o6afhL/1/ example:

If I set collapsed:true parameter for east panel and run this example then when I open east panel I see that toolbar is located not on top of the panel.

Can you check this?

Thanks,
//V


Title: Re: header panel in Layout
Post by: stworthy on April 04, 2016, 07:45:41 AM
The updated example below works fine.
http://jsfiddle.net/k0o6afhL/2/


Title: Re: header panel in Layout
Post by: mzeddd on April 12, 2016, 02:40:18 AM
Thanks stworthy!

I have one more question to this example.

There is a input element in panel. I'm going to have a number of input elements but part of them should be hidden for a while.

So, I put
Code:
<style>
    .hiddenElement {display:none}
</style>
<p class="hiddenElement"><b>test:</b>
<input id="test" name="tcName" class="easyui-textbox" style="width:100%" disabled></p>
<script>
function displayItemsByClassName(className,value){
var items = document.getElementsByClassName(className);
for (var i=0; i<items.length; i++) items[i].style.display = value;
}
</script>
Using displayItemsByClassName('hiddenElement','inline'); function call I show hidden elements but all of them do not look like if they were not hidden at the beginning. Input width is not 100% and behaves really strange when I resize 'east' panel.

Can you advice what should be done in order to get it fixed?