首页 > 其他 > 详细

easyui学习笔记5—panel加载其他的页面

时间:2014-01-17 09:14:59      阅读:573      评论:0      收藏:0      [点我收藏+]

上一篇中我们看到了panel的基本实现,没有什么难度,最重要的是data-options和class两个标签属性的定义。这里我们将看一下在panel中如何加载其他的页面。

1.先看看引用的资源文件和html

bubuko.com,布布扣
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8"/>
        <title>Load Panel Content - jQuery EasyUI Demo</title>
        <link rel="stylesheet" href="jquery-easyui-1.3.5/themes/default/easyui.css" />
        <link rel="stylesheet" href="jquery-easyui-1.3.5/themes/icon.css" />
        <link rel="stylesheet" href="jquery-easyui-1.3.5/demo/demo.css" />
        <script type="text/javascript" src="jquery-easyui-1.3.5/jquery.min.js"></script>
        <script type="text/javascript" src="jquery-easyui-1.3.5/jquery.easyui.min.js"></script>
    </head>
    <body>
        <h2></h2>
        <div class="demo-info">
            <div class="demo-tip icon-tip"></div>
            <div>Click the refresh button on top right of panel to load content.</div>
        </div>
        <div style="margin:10px 0;"></div>
        <div id="p" class="easyui-panel" title="Load Panel Content" style="width:500px;height:200px;padding:10px;" data-options="
            tools:[{iconCls:‘icon-reload‘,handler:function(){$(‘#p‘).panel(‘refresh‘,‘_content.html‘)}}]
        ">
            
        </div>
    </body>
</html>
bubuko.com,布布扣

这里没有什么要说的了还是两个主要的js文件jquery.min.jsjquery.easyui.min.js最主要的选项是data-options=" tools:[{iconCls:‘icon-reload‘,handler:function(){$(‘#p‘).panel(‘refresh‘,‘_content.html‘)}}] "指定了这个panel的标签样式和加载的页面,执行的动作是refresh。

2.再看看这个加载的html文件,其实就是一一段简单的文字,如下

 

bubuko.com,布布扣
<!DOCTYPE html>
<html>
<head>
        <meta charset="UTF-8">
        <title>AJAX Content</title>
</head>
<body>
        <p style="font-size:14px">Here is the content loaded via AJAX.</p>
        <ul>
                <li>easyui is a collection of user-interface plugin based on jQuery.</li>
                <li>easyui provides essential functionality for building modem, interactive, javascript applications.</li>
                <li>using easyui you don‘t need to write many javascript code, you usually defines user-interface by writing some HTML markup.</li>
                <li>complete framework for HTML5 web page.</li>
                <li>easyui save your time and scales while developing your products.</li>
                <li>easyui is very easy but powerful.</li>
        </ul>
</body>
</html>
bubuko.com,布布扣

easyui学习笔记5—panel加载其他的页面

原文:http://www.cnblogs.com/tylerdonet/p/3521760.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!