EasyUI Forum
September 14, 2025, 10:51:37 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: div.html(), div.load() and JeasyUI styles  (Read 8688 times)
fguibert
Newbie
*
Posts: 23


View Profile
« on: October 04, 2018, 03:28:10 AM »

Hi all

I'm trying to fill a div with JeasyUI widgets, by using JQuery's .html() and load() method.
but when I put Jeasyui content in the div, it didn't render correctly.

for example, a simple button in my page renders correctly, but when I try to load a Jeasyui button in a div content, it render only a link, not a button, like Jeasyui CSS was not found :

Code:
<!DOCTYPE html>
<html>
    <head>
        <title>Basic Form - jQuery EasyUI Demo</title>
        <link rel="stylesheet" type="text/css" href="https://www.jeasyui.com/easyui/themes/default/easyui.css">
        <link rel="stylesheet" type="text/css" href="https://www.jeasyui.com/easyui/themes/icon.css">
        <script type="text/javascript" src="https://www.jeasyui.com/easyui/jquery.min.js"></script>
        <script type="text/javascript" src="https://www.jeasyui.com/easyui/jquery.easyui.min.js"></script>
    </head>
    <body>
        <a id="btn" href="#" onclick="load()" class="easyui-linkbutton">click to load, this not work</a>

<div id="mydiv">
</div>
       
       
        <script>
        function load() {
        $('#mydiv').html(' <a id="btn2" href="#" class="easyui-linkbutton">not a jeasyui button</a>');
        }
        </script>
    </body>
</html>

any idea ? thanks a lot
« Last Edit: October 04, 2018, 05:53:21 AM by fguibert » Logged
Coder
Full Member
***
Posts: 101


View Profile
« Reply #1 on: October 12, 2018, 03:27:30 AM »

Code:
<script>
        function load() {
        $('#mydiv').html(' <a id="btn2" href="#" class="easyui-linkbutton">not a jeasyui button</a>');
        $('#btn2').linkbutton();
        }
        </script>
Logged
Coder
Full Member
***
Posts: 101


View Profile
« Reply #2 on: October 12, 2018, 03:48:06 AM »

or try "defer"
Code:
		<script type="text/javascript" defer="defer">

        function load() {
        $('#mydiv').html(' <a id="btn2" href="#" class="easyui-linkbutton">not a jeasyui button</a>');
        }
        </script>

or try my hook for bottompage <script src="https://code.jquery.com/jquery-2.2.4.min.js"> tag :

Code:
		<script type="text/javascript" defer="defer">
function doDialogInit(){
if ( window.jQuery && ($('#pageLoader').css('display') == 'none')){
          dlgABC_Init();
    dlgABCD_Init();
}else{
window.setTimeout("doDialogInit()",100);
}
};
doDialogInit();
</script>
Logged
fguibert
Newbie
*
Posts: 23


View Profile
« Reply #3 on: March 01, 2019, 04:11:58 AM »

thanks a lot coder, it works like a charm
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!