easyui学习笔记5—panel加载其他的页面
上一篇中我们看到了panel的基本实现,没有什么难度,最重要的是data-options和class两个标签属性的定义。这里我们将看一下在panel中如何加载其他的页面。
1.先看看引用的资源文件和html
<!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>
这里没有什么要说的了还是两个主要的js文件jquery.min.js和jquery.easyui.min.js最主要的选项是data-options=" tools:[{iconCls:'icon-reload',handler:function(){$('#p').panel('refresh','_content.html')}}] "指定了这个panel的标签样式和加载的页面,执行的动作是refresh。
2.再看看这个加载的html文件,其实就是一一段简单的文字,如下
<!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>
3.注意在jquery里面所有的关键字都是区分大小写的,这个和javascript是一致的
$('#centerContent').panel({
href:"_publish.html?Id="+selectedRow.Id,
onLoad:function(){
//alert("aa");
$('#comBusiness').combobox('setValue', selectedRow.Business);
if(selectedRow.Business!=null){
$('#comBusiness').combobox('setValue', selectedRow.Business);
}
if(selectedRow.Solution!=null){
$('#comSolution').combobox('setValue', selectedRow.Solution);
}
if(selectedRow.Service!=null){
$('#comService').combobox('setValue', selectedRow.Service);
}
if(selectedRow.About!=null){
$('#comAbout').combobox('setValue', selectedRow.About);
}
}
});
在这一段中,我错误的把onLoad写成了onload,然后悲剧了折磨了我两个小时,写成小写的是不管用的,切记,切记!
easyui学习笔记5—panel加载其他的页面的更多相关文章
- thinkphp学习笔记9—自动加载
原文:thinkphp学习笔记9-自动加载 1.命名空间自动加载 在3.2版本中不需要手动加载类库文件,可以很方便的完成自动加载. 系统可以根据类的命名空间自动定位到类库文件,例如定义了一个类Org\ ...
- node 学习笔记 - Modules 模块加载系统 (1)
本文同步自我的个人博客:http://www.52cik.com/2015/12/11/learn-node-modules-path.html 用了这么久的 require,但却没有系统的学习过 n ...
- Openstack本学习笔记——Neutron-server服务加载和启动源代码分析(三)
本文是在学习Openstack过程中整理和总结.因为时间和个人能力有限.错误之处在所难免,欢迎指正! 在Neutron-server服务载入与启动源代码分析(二)中搞定模块功能的扩展和载入.我们就回到 ...
- easyui学习笔记4—panel的实现
这篇看看easyui是怎么实现panel的,就是类似一个容器,里面可以装具体内容或者其他的easyui控件. 1.这里先看看引用的资源文件 <link rel="stylesheet& ...
- Spring学习笔记(1)——资源加载
<!-- 占坑,迟点补充底层原理 --> Spring支持4种资源的地址前缀 (1)从类路径中加载资源——classpath: classpath:和classpath:/是等价的,都是相 ...
- node 学习笔记 - Modules 模块加载系统 (2)
本文同步自我的个人博客:http://www.52cik.com/2015/12/14/learn-node-modules-module.html 上一篇讲了模块是如何被寻找到然后加载进来的,这篇则 ...
- 【EF学习笔记08】----------加载关联表的数据 显式加载
显式加载 讲解之前,先来看一下我们的数据库结构:班级表 学生表 加载从表集合类型 //显示加载 Console.WriteLine("=========查询集合===========&quo ...
- 【EF学习笔记07】----------加载关联表的数据 贪婪加载
讲解之前,先来看一下我们的数据库结构:班级表 学生表 贪婪加载 //贪婪加载 using (var db = new Entities()) { var classes = db.Classes.Wh ...
- 【EF学习笔记06】----------加载关联表的数据 延迟加载
讲解之前,先来看一下我们的数据库结构:班级表 学生表 延迟加载 //延迟加载 using (var db = new Entities()) { //查询班级 var classes = (from ...
随机推荐
- Yii “CDbConnection failed to open the DB connection: could not find driver"解决办法
前言:用Yii框架做项目时,有时会遇到“CDbConnection failed to open the DB connection: could not find driver”这个问题,这个问题通 ...
- 算法学习笔记之——priority queue、heapsort、symbol table、binary search trees
Priority Queue 类似一个Queue,但是按照priority的大小顺序来出队 一般存在两种方式来实施 排序法(ordered),在元素入队时即进行排序,这样插入操作为O(N),但出队为O ...
- Java给树加子节点个数统计
通过后台实现 private List<Photo> getChildren(Photo photo) { List<Photo> children = new ArrayLi ...
- 搭建简单FTP
搭建简单FTP 环境 CentOS 7 安装 yum install vsftpd 修改配置文件, 在/etc/vsftpd/vsftpd.conf中添加allow_writeable_chroot= ...
- SQL索引器
1.什么是SQL索引器 索引是对数据库表中一列或多列的值进行排序的一种结构,使用索引可快速访问数据库表中的特定信息. 数据库索引好比是一本书前面的目录,能加快数据库的查询速度. 例如这样一个查询:se ...
- css内容简介(层叠样式表)
css是对网页编辑的加色,是对其功能的渲染. 根据规范每个元素都有一个display属性,每个元素都有一个------------如div元素他的默认为block. 行内元素和块级元素 块级元素会占据 ...
- 自己玩虚拟机上mongo备份
rs.initiate({_id:"shard1RS",members:[{_id:1,host:"127.0.0.1:27018",priority:2},{ ...
- 分布式事务概述--2pc的概念
转载自一个大拿:http://www.cnblogs.com/LBSer/p/4715395.html 前阵子从支付宝转账1万块钱到余额宝,这是日常生活的一件普通小事,但作为互联网研发人员的职业病,我 ...
- SSM面试
Spring两大核心:IOC AOP DI AOP:所谓面向切面变成,是一种通过预编译和运行期动态化代理的方式实现了再不修改源代码的情况下给程序动态添加功能的技术. Mybatis(半自动化实现obj ...
- 【每日一linux命令】
参考文章 1.[每日一linux命令]