mtpGrid.formatCheckBox = function(gridId, radio) {
return function(inDatum, rowIndex) {
var checks = eval(gridId+'.checks');
return '<input type="'+(radio?'radio':'checkBox')+'" name="'+gridId+'.checkBox" id="'
+gridId+'.'+inDatum+'" '+ (checks[inDatum]!=null?'checked':'')
+ ' onclick="mtpGrid.on'+(radio?'Radio':'CheckBox')+'Selected(\''+gridId+'\', this.id, '+rowIndex+')"/>'
+ '<label for="'+gridId+'.'+inDatum+'" class="access">'+gridId+'.'+inDatum+'</label>';
};
}
mtpGrid.formatDate = function(inDatum, rowIndex){
if(inDatum){
if (inDatum.time) inDatum=inDatum.time;
return dojo.date.locale.format(new Date(inDatum),
{datePattern:"dd MMM yyyy", selector:"date"});
}else{
return "";
}
};
mtpGrid.formatNumber = function(inDatum, rowIndex){
if(inDatum != null){
return dojo.number.format(new Number(inDatum),
{pattern:"#,##0.00"});
}else{
return "";
}
};
mtpGrid.formatTime = function(inDatum, rowIndex){
if(inDatum){
if (inDatum.time) inDatum=inDatum.time;
return dojo.date.locale.format(new Date(inDatum),
{datePattern:"dd MMM yyyy"});
}else{
var result = "<span style = 'color: #666;'> N/A </span>";
return result;
}
};
分享到:
相关推荐
jsp页面格式化数字类型,如日期格式化 小数点格式化等
本文档讲解了在struts2中格式化日期、时间和数字
C#中数字以字串格式格式化输出 日期时间以字串格式输出
EL表达式的一些操作。包括字符串处理,时间日期的格式化,数字处理
C#日期格式化汇总,迅速让你掌握日期格式化,例如: MM 月份数字。一位数的月份有一个前导零。 MMM 月份的缩写名称,在 AbbreviatedMonthNames 中定义。 MMMM 月份的完整名称,在 MonthNames 中定义。 y 不包含...
获取字符传中的数字 格式化数据类型 判断字符是否为中文等
SQL\日期、數字格式化函数大全
Java字符串 日期 数字格式化输出.docJava字符串 日期 数字格式化输出.docJava字符串 日期 数字格式化输出.docJava字符串 日期 数字格式化输出.docJava字符串 日期 数字格式化输出.docJava字符串 日期 数字格式化输出...
日期时间 及 数字的 格式化 参数 大全
VB 中 Format 格式化日期时间、数字函数功能详解,详情包含有: 数字类型的格式化 日期类型的格式化 文本类型的格式化 强制使用中文格式的日期时间 总结:这是一份不可多得的珍贵珍藏版资源!!!
Freemarker_内置函数_数字、字符串、日期格式化.txt
对前端日期进行格式化,用法如下: /** // 对Date的扩展,将 Date 转化为指定格式的String // 月(M)、日(d)、小时(h)、分(m)、秒(s)、季度(q) 可以用 1-2 个占位符, // 年(y)可以用 1-4 个占位符,毫秒(S)只能用 1...
NULL 博文链接:https://anole1982.iteye.com/blog/1855800
包含freemarker中常用的字符串函数、日期格函数、sequence函数、Hash函数和浮点数字格式化输出等的介绍和相关实例,很好理解和掌握的
格式化日期: DATE_FORMAT(date, format) 注: date:时间字段 format:日期格式 返回系统日期,输出 2009-12-25 14:38:59 select now(); 输出 09-12-25 select date_format(now(),'%y-%m-%d'); 根据format字符...
java
最近因为工作的需求,需要对mysql中数字进行格式化,但发现网上的资料较少,索性自己总结一下,方便自己也帮助有需要的朋友们,下面话不多说,来一起看看详细的介绍: 一、format函数: 格式化浮点数 format(number...