EasyUI Forum
May 16, 2024, 06:23:47 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: Buttons in Window Footer Similar to Dialog Buttons  (Read 2022 times)
poeziafree
Jr. Member
**
Posts: 69


View Profile Email
« on: February 17, 2022, 04:53:37 AM »

Hello,

Ajax loads html form in Window.
I would like to have a submit button in Window footer (Window is created by ajax);

How can I achieve Dialog like buttons functionality in window footer?
Logged
jarry
Administrator
Hero Member
*****
Posts: 2264


View Profile Email
« Reply #1 on: February 18, 2022, 12:22:41 AM »

Here is an example that shows how to build a toolbar on the bottom of the window.
Code:
<div class="easyui-window f-column" style="width:400px;height:200px;">
<div class="f-full f-column" style="overflow:hidden">
<div style="overflow:auto;position:absolute;width:100%;height:100%">
<p>Window content.</p>
<p>Window content.</p>
<p>Window content.</p>
<p>Window content.</p>
<p>Window content.</p>
<p>Window content.</p>
</div>
</div>
<div style="padding:5px 10px;text-align:center;background:#efefef;">
<a href="javascript:;" class="easyui-linkbutton">Submit</a>
</div>
</div>
Logged
poeziafree
Jr. Member
**
Posts: 69


View Profile Email
« Reply #2 on: February 18, 2022, 12:52:13 AM »

Here is an example that shows how to build a toolbar on the bottom of the window.
Code:
<div class="easyui-window f-column" style="width:400px;height:200px;">
<div class="f-full f-column" style="overflow:hidden">
<div style="overflow:auto;position:absolute;width:100%;height:100%">
<p>Window content.</p>
<p>Window content.</p>
<p>Window content.</p>
<p>Window content.</p>
<p>Window content.</p>
<p>Window content.</p>
</div>
</div>
<div style="padding:5px 10px;text-align:center;background:#efefef;">
<a href="javascript:;" class="easyui-linkbutton">Submit</a>
</div>
</div>


Thanks. But what if I create the window programmatically not through html code?
Logged
jarry
Administrator
Hero Member
*****
Posts: 2264


View Profile Email
« Reply #3 on: February 19, 2022, 12:24:05 AM »

Call this code to create it programmatically.
Code:
var win = $('#win');
win.window({
width: 400,
height: 200,
bodyCls: 'f-column'
})
var inner = $('<div class="f-full f-column" style="overflow:hidden"></div>').appendTo(win);
var container = $('<div style="overflow:auto;position:absolute;width:100%;height:100%"></div>').appendTo(inner);
var bar = $('<div style="padding:5px 10px;text-align:center;background:#efefef;"></div>').appendTo(win);
var button = $('<a href="javascript:;">Submit</a>').appendTo(bar).linkbutton({
onClick: function(){
console.log('Submit')
}
})
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!