EasyUI Forum
September 23, 2025, 03:18:23 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: How to add easyui panel into div (normal div)?  (Read 5329 times)
Aod47
Jr. Member
**
Posts: 85


View Profile
« on: October 16, 2019, 11:35:13 PM »

It's sound like easy but I can't do that.  Huh

Could you please advice? Thank you.

Code:
<div id="Div1">
   
</div>

<a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-add'" onclick="addPanel()">Add Panel</a>

<script>
function addPanel() {

            var pp = $('#pp').panel({
                width: 500,
                height: 150,
                title: 'My Panel',
                tools: [{
                    iconCls: 'icon-add',
                    handler: function() { alert('new') }
                        }, {
                    iconCls: 'icon-save',
                    handler: function() { alert('save') }
                    }]
                });

            $("#Div1").append(pp);
                 
  }
</script>

Logged
Aod47
Jr. Member
**
Posts: 85


View Profile
« Reply #1 on: October 17, 2019, 05:45:32 PM »

I got it! very easy Grin


Code:
function addPanel() {
           
            $('<div id="pp"></div>').appendTo('#Div1');
           
            $('#pp').panel({
                width: 500,
                height: 150,
                title: 'My Panel',
                tools: [{
                    iconCls: 'icon-add',
                    handler: function() { alert('new') }
                        }, {
                    iconCls: 'icon-save',
                    handler: function() { alert('save') }
                    }]
                });
}
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!