EasyUI Forum
September 14, 2025, 04:46:11 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: Create panel  (Read 10268 times)
evaj
Newbie
*
Posts: 13


View Profile Email
« on: November 29, 2012, 01:10:36 AM »

Hello
I'm trying create a panel dinamically but I haven't success, this is my code:

function panel()
{
    var my_div = null;
    var divTag = null;
    var divTag = document.createElement("div");
    divTag.id = "p";
    divTag.className ="easyui-panel";
    divTag.setAttribute("align","center");
    divTag.className ="easyui-panel";
    divTag.title="Datos";
    divTag.collapsible="true";
    divTag.style.width="1230px";
    divTag.style.height="auto";
    divTag.style.padding="10px";
   
    my_div = document.getElementById("org_div1");
    document.body.insertBefore(divTag, my_div);

}

<body onload=panel()">
        <div id='org_div1'> </div>
  </body>

But, this code works
<body">
        <div id="p" align="center" class="easyui-panel" title="Datos" style="width: 1230px; height: auto; padding: 10px;"></div>
  </body>

Please Could you help me?

Thanks
Regards
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: November 29, 2012, 01:31:35 AM »

Add the following statement on the bottom of your function(panel) to create the panel.

$(divTag).panel();
Logged
evaj
Newbie
*
Posts: 13


View Profile Email
« Reply #2 on: November 29, 2012, 01:50:34 AM »

Thank you very much, It's works!!!
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!