EasyUI DataGrid 应用示例
2015-11-03 17:38
513 查看
我们使用如下标签来创建表格
JS代码如下:
然后设置表格的数据源
$('#dg').datagrid('loadData', [{'TIME':'2015-09-23','SUM_NUM':'40'},{......}]);
本文出自 “因简单而自在” 博客,请务必保留此出处http://dengshuangfu.blog.51cto.com/8794650/1709274
<table id="dg"></table> |
$('#dg').datagrid({ columns:[[ {field:'TIME',title:'标题1,width:140}, {field:'SUM_NUM',title:'标题2,width:140, styler:function(value,row,index){ if (value < 20){ return 'background-color:#ffee00;color:red;text-decoration: underline;'; } }}, {field:'PROVINCE_NUM',title:'标题3,width:140,align:'right'}, {field:'GROUP_NUM',title:'标题4',width:140, styler:function(value,row,index){ if (value < 20){ // 返回css里面定义的样式 return {class:'c1',style:'color:red'} } }} ]] , height:360, pageSize:10, showHeader:true, //是否显示头部 rownumbers:true, //是否显示行数 pagination:true , //是否显示分页组件 rowStyler: function(index,row){ if (row.SUM_NUM>80){ return 'background-color:#6293BB;color:#fff;'; } }, onClickCell:function(index,field,value){ /* index:行索引,0开始 field:所选列绑定的field名 value:该单元格显示的内容 */ } }); |
$('#dg').datagrid('loadData', [{'TIME':'2015-09-23','SUM_NUM':'40'},{......}]);
本文出自 “因简单而自在” 博客,请务必保留此出处http://dengshuangfu.blog.51cto.com/8794650/1709274
相关文章推荐
- UITextField在弹出的键盘上方,加一个带有完成按钮的toolBar工具栏
- [LeetCode]Longest Increasing Subsequence
- [LeetCode]Longest Increasing Subsequence
- iOS之自动生成UUID
- android ui的几个概念:px,dip(dp),sp,dpi,分辨率等
- EAS BOS代码添加F7Query
- Week1-7Linguistics
- Building fw printenv and fw setenv
- Web Service单元测试工具实例介绍之SoapUI
- Easyui的一些简单用法
- 关于论文Silhouteete-based human action recognition using sequences of key poses
- ios UITextView的placeHolder的设置
- easyUI datagrid导出excel(所见即所得)
- Codeforces Round #328 (Div. 2)B. The Monster and the Squirrel
- UITableView和UITableViewCell 图解
- Android设计模式源码解析之Builder模式
- NavigationController界面跳转,UITableView基本用法
- gitlab Sign in 报错:You have to confirm your account before continuing.
- Zoho Recruit助人力外包公司提供满意服务
- Servlet、Request、Response、filter、listener