之前做的一个商城项目,后台系统页面使用Easyui做的,记录一个当时卡住的地方:

首先通过<table>标记创建数据网格(datagrid)

<table class="easyui-datagrid" id="contentList" data-options="toolbar:contentListToolbar,singleSelect:false,collapsible:true,pagination:true,method:'get',pageSize:20,url:'*******',queryParams:{categoryId:0}">
    <thead>
    <tr>
   <th data-options="field:'id',width:30">ID</th>
   <th data-options="field:'title',width:120">内容标题</th>
   <th data-options="field:'subTitle',width:100">内容子标题</th>
   <th data-options="field:'pic',width:50,align:'center'">图片</th>
   <th data-options="field:'created',width:130,align:'center'">创建日期</th>
   <th data-options="field:'updated',width:130,align:'center'">更新日期</th>
</tr>
</thead>
</table>

接着在js写一个方法并引用

formatDateTime : function(val,row){

var now = new Date(val);
 return now.format("yyyy-MM-dd hh:mm:ss");

}

最后在需要更改那一栏添加改方法

<th data-options="field:'created',width:130,align:'center',formatter:E3.formatDateTime">创建日期</th>

<th data-options="field:'updated',width:130,align:'center',formatter:E3.formatDateTime">更新日期</th>

效果如下:

End——————————————————————

最新文章

  1. VS2010中的查找和替换中正则的使用
  2. 转@ManyToMany- annotation关系映射篇(下)
  3. sql 邮件发送测试情况
  4. address
  5. iOS开发之如何修改Mac截屏保存路径
  6. Ubuntu配置LAMP+MediaWiki及常见问题
  7. Nginx 性能优化
  8. php 自带过滤和转义函数
  9. 1483:[HNOI]2009 梦幻布丁 - BZOJ
  10. Python顺序与range和random
  11. JSON 学习笔记
  12. SGU 415. Necessary Coins ( 背包dp )
  13. Dubbo(五) Dubbo入门demo——helloworld
  14. (最简单)红米手机5A的USB调试模式在哪里开启的方法
  15. 从数据库取出两个同样的字符串用equals比较返回false
  16. jqgrid表头上面再加一行---二级表头
  17. 洛谷P2257 YY的GCD
  18. [转]jvm加载类规则
  19. 洛谷 P2629 好消息,坏消息
  20. Managing DbContext the right way with Entity Framework 6: an in-depth guide by mehdime

热门文章

  1. VNware上安装虚拟机Ubuntu16.10 并安装petalinux(版本问题的坑 弃帖 另开一帖)
  2. CH5E26 扑克牌 (计数类DP)
  3. 前端每日实战:25# 视频演示如何用纯 CSS 创作一个慧星拖尾效果的 loader 动画
  4. AIX下绑定双网卡
  5. 对webpack的初步研究4
  6. 安装VueCli-3.0
  7. WINDOWS2008server安全策略设置
  8. python保存selenium的cookies写入和读出
  9. vue键盘修饰符
  10. jmeter之线程组循环次数