- 博客(21)
- 资源 (1)
- 收藏
- 关注
原创 Promise/Deferred模式
2009年,CommonJS出土了Promise/Deferred模式,这里主要介绍其中Promises/A模型。在以前异步编程中,必须先预定事件的执行流程,而Promise/Deferred模式解决了‘先执行异步调用,延迟传递处理’这样的问题。其实这种模式最早出现于Dojo中。promise 对象有一个then方法,用来存储三种状态(未完成,已完成,失败)的回调函数def
2016-11-12 21:57:45
1101
原创 javascript利用arguments实现方法重载机制
javascript支持方法的重写,但是没有方法重载机制,那么可以模仿重载机制吗?答案是肯定的。(在这里补充一下重写和重载的区别,笔者曾几何时一度混淆。重写是子类覆盖父类的方法,方法名/参数列表/函数返回类型 必须相同;重载是同一个类中多个方法实现,方法名必须相同,参数列表必须不同,返回类型可以不同 )利用全局变量arguments可以实现,arguments是数组,通过判断传入参数的长度
2015-05-06 09:57:29
2461
2
原创 Kendo UI:Grid中单元格为下拉框/时间控件等
问题Grid中如何自定义单元格input框的类型,如下拉框,时间控件等?解决方案通过editor选项设置,如下拉框类型(以ComboBox为例){ field: "pageLayoutTemplateId", title: "布局模板*", width: 100,
2014-11-27 17:18:13
6298
原创 Kendo UI:Grid自定义command实现对行数据的操作
问题Grid中如何自定义操作列?解决方案通过click选项设置,如{ name: "details", click: function(e) { var tr = $(e.target).closest("tr"); // get the current table row (tr) var dat
2014-11-27 15:06:45
9164
原创 Kendo UI:Grid中标题css样式设置
问题Grid表格的标题样式怎么设置?解决方案使用headerAttributes属性设置,如果有css中class属性,需要加双引号””.如{ field: "name", headerAttributes: { "class": "table-header-cell", style: "text-align: right; font-s
2014-11-27 15:05:43
10606
原创 Kendo UI:Grid中单元格样式控制
问题Grid某个单元格的样式怎么设置?解决方案使用attributes属性设置,如果有css中class属性,需要加双引号””.如{ field: "name", title: "Name", attributes: { "class": "table-cell", style: "text-align: right; f
2014-11-27 15:02:57
8511
原创 Kendo UI:Grid中单元格日期格式化
Grid中怎么格式化时间类型数据?解决方案(1)使用format格式化 { field: "updateTime", title: "更新时间", width: 200, format: "{0: yyyy-MM-dd HH:mm:ss}"
2014-11-27 15:00:09
9578
原创 Kendo UI:Grid中单元格的数据源的设置-field选择域的问题
问题Grid中数据如果不显示model中field值,怎么设置?解决方案使用kendotemplate: # if(domainInfoNames) {# #:domainInfoNames# # }else{ # 无 #}#{field: "domainInfoIds",title: "页面组",width: 2
2014-11-27 14:57:02
3979
原创 KendoUI:Grid控件的使用
1.创建和基本选项配置有两种创建grid的方式,我这里使用已存在的html div标签,然后再将div元素kendo化.$(function(){ $('#grid') .kendoGrid({ dataSource : dataSource, //数据源加载 pageable : { //分页信息选项设置 input :
2014-11-27 14:27:01
14280
原创 using thymeleaf 之 th:each迭代循环
th:each属性用于迭代循环,语法:th:each="obj:${objLis}"
2014-11-02 15:49:32
131489
原创 using thymeleaf之七设置属性的值(th:attr/th:value/th:alt-title/th:attrappend/th:attrprepend/th:checked)
7.1 th:attr用于设置其他属性的值,但不是所有属性的值都能设置,如text。
2014-10-18 20:44:48
24254
原创 using thymeleaf之六th:text/th:utext属性
6.1 th:text属性l可对表达式或变量求值,并将结果显示在其被包含的 html 标签体内替换原有html文本l文本链接: l用“+”符号,若是变量表达式也可以用“|”符号
2014-10-18 20:35:59
16133
原创 using thymeleaf之四操作符
4.1算术操作符+, -, *, /, %e.g.+:1+1.-: 2-1.*:2*3./: 9/4.%:9%4.
2014-10-18 20:23:47
3625
原创 using thymeleaf之三文字
3.文字3.1 文本......3.2 数字The year is 1492.In two years, it will be 1494.3.3 布尔值:true,false3.4 null:null3.5 文字符号:one, sometext, main,…
2014-10-18 20:19:29
1492
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人