EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: evaj on November 29, 2012, 01:10:36 AM



Title: Create panel
Post by: evaj 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


Title: Re: Create panel
Post by: stworthy 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();


Title: Re: Create panel
Post by: evaj on November 29, 2012, 01:50:34 AM
Thank you very much, It's works!!!