EasyUI之data-options

来源:互联网 发布:综漫 收集数据做主神 编辑:程序博客网 时间:2024/06/06 14:11

今天学习EasyUI,对 data-options属性不是很理解。感觉他功能强大。但是却不知怎么用。

很多地方都遇到:但是终究还是不理解它到底是干嘛的?

例如:

<form id="ff" method="post">       <div>           <label for="name">Name:</label>           <input class="easyui-validatebox" type="text" name="name" data-options="required:true" />       </div>       <div>           <label for="email">Email:</label>           <input id="email" class="easyui-validatebox" type="text" name="email" data-options="validType:'email'" />       </div>      </form> 
还有:

<!-- ====工具栏。【data-options属性。】 ====【API:LinkButton(按钮)】--><div class="easyui-dialog" style="width:600px;height:300px"data-options="title:'My Dialog',modal:true,toolbar:[{text:'编辑',iconCls:'icon-edit',handler:function(){alert('edit-----')}},{text:'帮助',iconCls:'icon-help',handler:function(){alert('help+++++')}}]">对话框窗口内容。=====【js实现方式??工具栏的实现是:使用对话框div加个【data-option属性,属性值添加toolbar项。】 ======所以没有JS实现方式?。】</div>

还有:

<%@ page language="java" contentType="text/html; charset=UTF-8"    pageEncoding="UTF-8"%><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Insert title here</title><!-- ==######==EasyUI必须有的 2个css,2个js  ==######==【去哪里找?】==随意打开一个案例,查看源码 根据源码路径寻找。--> <link rel="stylesheet" type="text/css" href="../css/easyui.css"> <link rel="stylesheet" type="text/css" href="../css/icon.css"> <script type="text/javascript" src="../js/jquery.min.js"></script> <script type="text/javascript" src="../js/jquery.easyui.min.js"></script></head><body><!-- DataGrid组件实现 。表格显示多行数据列表。--><table class="easyui-datagrid" style="width:400px;height:250px"           data-options="url:'datagrid_data.json',fitColumns:true,singleSelect:true">       <thead>           <tr>               <th data-options="field:'code',width:100">编码</th>               <th data-options="field:'name',width:100">名称</th>               <th data-options="field:'price',width:100,align:'right'">价格</th>           </tr>       </thead>   </table>  </body></html>


=============以上是遇到的很多地方。不一一列举。

找到一篇文章,挺好的。【http://blog.csdn.net/u010375663/article/details/42198563#comments】

他的总结:【总结:data-option就是一个可以在标签等容器中显示图标的方法。

希望可以早点理解。

又参考了一篇:【http://blog.csdn.net/shakawjh/article/details/38400847】只能这样记住吗?可以具体点?


原创粉丝点击