EasyUI学习
1.基础知识:
1)Parser解析器:
div指定了class后能有效果是因为开始时文档时加载DOM但是一些由js动态生成的指定了class的div没有被解析此时就需要手动解析了
js动态生成的指定了Class的div对象需要手动解析
$.parser.parse(); // 解析整个页面;$.parser.parse('#cc'); // 解析某个具体节点
2)Easyloader:加载器:类似与模块加载与requireJS类似
用这个方式来加载对应的easyui控件很方便,他能自动找到需要的控件
"easyloaderId">我是一个easyLoader测试用例
两种方式加载文件:easyloader.load('插件',function(){//dosomethings});
using("url相对位置或者绝对位置",function(){//dosomethings})
3)easyui-draggable拖动
4)droppable可放置
5)easyui-resizable可调整尺寸
6)easyui-pagination分页
调用方法:$('#pp').pagination('refresh');
绑定事件:
$('#pp').pagination({ onSelectPage:function(pageNumber, pageSize){ $(this).pagination('loading'); alert('pageNumber:'+pageNumber+',pageSize:'+pageSize); $(this).pagination('loaded'); } });
添加自定义按钮
$('#pp').pagination({ total: 114, buttons: [{ iconCls:'icon-add', handler:function(){alert('add')} },'-',{ iconCls:'icon-save', handler:function(){alert('save')} }] });
7)'easyui-searchbox搜索框
1.7Searchbox搜索框
class="easyui-searchbox" style="width: 300px;" data-options="searcher:qq,prompt:'Please Input Value',menu:'#mm'"/>"mm" style="width:120px">"searchbox">"name:'all',iconCls:'icon-ok'">All News"name:'sports'">Sports News"mm" style="width:120px">"name:'all',iconCls:'icon-ok'">All News"name:'sports'">Sports News