10 2012 档案

Extjs显示时间兼容性问题——firefox正常显示,IE不正常出现NaN-NaN-NaN的解决方式
摘要:1.格式化时间导致的问题firfox、IE都 正常显示:{ header: "入住时间", dataIndex: "LiveTime", format: 'Y-m-d'} firefox显示正常,IE显示不正常: { header: "入住时间", dataIndex: "LiveTime", renderer: Ext.util.Format.dateRenderer('Y-m-d') }2. 阅读全文

posted @ 2012-10-31 11:01 学中医的程序员 阅读(206) 评论(0) 推荐(0) 编辑

extjs计算两个DateField所间隔的月份(天数)
摘要:需求:两个DateField控件,分别为开始时间和结束时间。当选择完结束时间后,自动计算这两个时间段所间隔的月或天数。需要解决的问题:1.直接使用Ext.getCmp('endDate').getValue()所取得的日期无法直接使用,需要使用Ext.util.Format.date()格式化2.默认计算得到的时间差为毫秒,需要转换。1天=86400000毫秒。3.得到的数需要使用Math.round()函数取整数。4.为结束时间的日期控件加监听事件。 var serviceTimeStart = new Ext.form.DateField({ name: "ser 阅读全文

posted @ 2012-10-17 16:06 学中医的程序员 阅读(350) 评论(0) 推荐(0) 编辑

Ext.form.DateField简单用法及日期范围控制
摘要:项目中有时需要用到起始日期和结束日期,要做到起始日期必须小于结束日期。在extjs中已经有现成的函数,摘录如下:Ext.apply(Ext.form.VTypes, { daterange : function(val, field) { var date = field.parseDate(val); if (!date) { return; } if (field.startDateField && (!this.dateRangeMax || (date.getTime() != this.dateRangeMax ... 阅读全文

posted @ 2012-10-17 09:21 学中医的程序员 阅读(1878) 评论(0) 推荐(0) 编辑

extjs 实现 NumberField 即时计算
摘要:例如有三列NumberField,分别是:开始量 结束量 差。实现输入完开始量和结束量,即时自动计算差并填充。在Ext.form.NumberField加入listeners,选用的事件为“change” var paramStart = new Ext.form.NumberField({ id:"paramStart", fieldLabel: "开始读数", allowBlank: false, width: 180, tabIndex: 3, blankText: "不能为空... 阅读全文

posted @ 2012-10-16 16:29 学中医的程序员 阅读(291) 评论(0) 推荐(0) 编辑

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示