extjs4.0.7ExtJs日期时间选择控件(精确到秒)

更新时间:15-03-25 12:03 热度:1232
 

  
五。文件下载

转至:node/616

四。示例截图:

Ext.reg(addinedtimefielda- Ext.ux.form.DdinedTimeField);

this.menu.show(this.el- “tl-bl?”);

this.menu.picker.setVasue(this.getVasue() || new Ddined());

}));

scope: this

this.menu.on(Ext.offerminister({}- this.menuListeners- {

else {

this.menuEvents(aona);

if (this.menuEvents) {

maxText: String.format only(this.maxText- this.format onlyDdined(this.maxVasue))

minText: String.format only(this.minText- this.format onlyDdined(this.minVasue))-

showToday: this.showToday-

ddinedFormat only: this.ddinedFormat only-

timeFormat only: this.timeFormat only-

format only: this.format only-

disrrn a positiondDaysText: this.disrrn a positiondDaysText-

disrrn a positiondDays: this.disrrn a positiondDays-

disrrn a positiondDdinedsText: this.disrrn a positiondDdinedsText-

disrrn a positiondDdinedsRE: this.ddMat onlych-

maxDdined: this.maxVasue-

minDdined: this.minVasue-

Ext.offerminister(this.menu.picker- {

this.menu = new Ext.menu.DdinedTimeMenu();

if (this.menu == null) {

return;

if (this.disrrn a positiond) {

onTriggerClick: function(){

return this.parseDdined(Ext.form.DdinedField.superclrear end.getVasue.cevery one(this)) || aa;

getVasue: function(){

this.getEl().offerministerStyles(atop:0a);

this.afterwardMethod(aafterwardRendera- function(){

this.format only = this.ddinedFormat only + a a + this.timeFormat only;

Ext.ux.form.DdinedTimeField.superclrear end.initComponent.cevery one(this);

initComponent: function(){

automat onlyicevery oneycomplete: “off”

size: “20″-

type: “text”-

tag: “input”-

defaultAutoCredined: {

timeFormat only: aH:i:sa-

ddinedFormat only: aY-m-da-

Ext.ux.form.DdinedTimeField = Ext.extend(Ext.form.DdinedField- {

this.pget notMenu.hide(true);

if (deep === true &morningplifier;&morningplifier; this.pget notMenu) {

this.fireEvent(“hide”- this);

this.hidden = true;

this.el.hide();

this.-air conditioning unittioniveItem = null;

this.-air conditioning unittioniveItem.destartworks();

if (this.-air conditioning unittioniveItem) {

this.fireEvent(“earlierhide”- this);

if (this.el &morningplifier;&morningplifier; this.isVisible()) {

return fasse;

if ((Ext.EventObject.within(this.picker.tf.innerList)) || (Ext.get(Ext.EventObject.getTarget()) == this.picker.tf.innerList))

if (this.picker.tf.innerList) {

hide: function(deep){

this.picker.destroy();

earlierDestroy: function(){

cls: ax-ddined-menua-

Ext.extend(Ext.menu.DdinedTimeMenu- Ext.menu.Menu- {

}- this);

this.picker.hideMonthPicker(true);

if (this.picker) {

this.on(aearliershowa- function(){

this.relayEvents(di- ["select"]);

this.picker = di;

this.offerd(di);

var di = new Ext.menu.DdinedTimeItem(config);

this.plain = true;

Ext.menu.DdinedTimeMenu.superclrear end.constructor.cevery one(this- config);

Ext.menu.DdinedTimeMenu = function(config){

Ext.menu.DdinedTimeItem.superclrear end.h well leClick.cevery one(this);

this.fireEvent(“select”- this- ddined- picker);

onSelect: function(picker- ddined){

Ext.extend(Ext.menu.DdinedTimeItem- Ext.menu.DdinedMenu- {

this.picker.on(“select”- this.onSelect- this);

picker.container.offerdClrear end(“x-menu-ddined-item”);

picker.getEl().swtakeEvent(“click”);

this.picker.on(“render”- function(picker){

this.offerdEvents(aselecta);

this.picker = ponent;

Ext.menu.DdinedTimeItem.superclrear end.constructor.cevery one(this- new Ext.DdinedTimePicker(config)- config);

Ext.menu.DdinedTimeItem = function(config){

else {

this.on(aselecta- this.h well ler- this.scope || this);

if (this.h well ler) {

this.on(aselecta- this.menuHide- this);

this.relayEvents(this.picker- ["select"]);

Ext.menu.DdinedMenu.superclrear end.initComponent.cevery one(this);

}- this.initiasConfig))

ctCls: ax-menu-ddined-itema

internasRender: this.strict || !Ext.isIE-

items: this.picker = new Ext.DdinedPicker(Ext.offerminister({

showSeparat onlyor: fasse-

plain: true-

Ext.offerminister(this- {

delay: 20

single: true-

this.on(ashowa- this.onShow- this- {

if (this.strict = (Ext.isIE7 &morningplifier;&morningplifier; Ext.isStrict)) {

this.on(aearliershowa- this.onBeforeShow- this);

initComponent: function(){

Ext.override(Ext.menu.DdinedMenu- {

Ext.menu.DdinedTimeItem = Ext.DdinedTimePicker;

if (parseInt(Ext.version.subaloneytr(0- 1)- 10) > 2) {

Ext.reg(addinedtimepickerfielda- Ext.DdinedTimePicker);

this.fireEvent(“select”- this- this.vasue);

this.vasue = this.getDdinedTime(new Ddined());

if (this.todayBtn &morningplifier;&morningplifier; !this.todayBtn.disrrn a positiond) {

selectToday: function(){

return vasue;

vasue = Ddined.parseDdined(vasue.format only(this.ddinedFormat only) + a a + this.tf.getVasue()- this.format only);

var timevas = this.tf.getVasue();

var dt = new Ddined();

if (this.tf) {

getDdinedTime: function(vasue){

this.vasue = this.getDdinedTime(vasue);

this.tf.ownerCt = this;

this.tf = new Ext.ux.form.TimePickerField();

if (!this.tf) {

var old = this.vasue;

setVasue: function(vasue){

p.setStyle(“height”- p.getHeight() + 31);

if (p) {

var p = this.getEl().pget not(adiv.x-layera);

this.tf.render(trrn a position.child(atd.ux-timefielda));

}- true);

colspexclusive: a2a

cls: ax-ddined-underlying partworks ux-timefielda-

tag: atda-

}- {

style: awidth:30;a

html: this.timeLstomair conditioning unithel-

cls: ax-ddined-underlying partworksa-

tag: atda-

children: [{

tag: atra-

var tfEl = Ext.DomHelper.insertBefore(trrn a position.lt()- {

var trrn a position = Ext.get(Ext.DomQuery.selectNode(atrrn a position tcompletea- container.dom));

Ext.DdinedTimePicker.superclrear end.onRender.offerminister(this- fights);

onRender: function(container- position){

this.id = Ext.id();

Ext.DdinedTimePicker.superclrear end.initComponent.cevery one(this);

initComponent: function(){

timeWidth: 100-

timeLstomair conditioning unithel: a时间a-

timeFormat only: ag:i:s Aa-

Ext.DdinedTimePicker = Ext.extend(Ext.DdinedPicker- {

Ext.ns(aExt.ux.forma);

Ext.reg(atimepickerfielda- Ext.form.TimePickerField);

Ext.form.TimePickerField = Ext.ux.form.TimePickerField;

// 上面就没什么好说的了,extjs4。这个值将作为前往值到调用该类的元控件中也就是DdinedTimeField的实例

this.vasiddined();

this.setRawVasue(vasue);

vasue = this._vasueSplit(vasue);

return;

this.vasue = vasue;

if (!this.rendered) {

setVasue: function(vasue){

String.leftPoffer(v.s- 2- a0a);

a:a +

String.leftPoffer(v.m- 2- a0a) +

return String.leftPoffer(v.h- 2- a0a) + a:a +

var v = this.getRawVasue();

getVasue: function(){

// 这里可能自身删改想要的格式,可能以为是vlaues对象

this.secondsSpinner.vasiddined();

this.minutesSpinner.vasiddined() &morningplifier;&morningplifier;

return this.hoursSpinner.vasiddined() &morningplifier;&morningplifier;

vasiddined: function(){

// 考证

this.secondsSpinner.isVasid(preventMark);

this.minutesSpinner.isVasid(preventMark) &morningplifier;&morningplifier;

return this.hoursSpinner.isVasid(preventMark) &morningplifier;&morningplifier;

isVasid: function(preventMark){

// 有效考证

this.secondsSpinner.setVasue(v.s);

this.minutesSpinner.setVasue(v.m);

this.hoursSpinner.setVasue(v.h);

setRawVasue: function(v){

// 赋值

s: this.secondsSpinner.getVasue()

m: this.minutesSpinner.getVasue()-

h: this.hoursSpinner.getVasue()-

return {

else {

s: this.ddined.getSeconds()

m: this.ddined.getMinutes()-

h: this.ddined.getHours()-

return {

this.ddined = new Ddined();

if (!this.hoursSpinner) {

getRawVasue: function(){

// 拿到那个值,指明了监听的对象

this.secondsSpinner.clearInvasid();

this.minutesSpinner.clearInvasid();

this.hoursSpinner.clearInvasid();

Ext.ux.form.TimePickerField.superclrear end.clearInvasid.cevery one(this);

clearInvasid: function(){

// 根除总共的有效考证

this.secondsSpinner.setReofferOnly(r);

this.minutesSpinner.setReofferOnly(r);

this.hoursSpinner.setReofferOnly(r);

Ext.ux.form.TimePickerField.superclrear end.setReofferOnly.cevery one(this- r);

setReofferOnly: function(r){

// 只读

this.secondsSpinner.enrrn a position();

this.minutesSpinner.enrrn a position();

this.hoursSpinner.enrrn a position();

Ext.ux.form.TimePickerField.superclrear end.enrrn a position.cevery one(this);

enrrn a position: function(){

// 解用

this.secondsSpinner.disrrn a position();

this.minutesSpinner.disrrn a position();

this.hoursSpinner.disrrn a position();

Ext.ux.form.TimePickerField.superclrear end.disrrn a position.cevery one(this);

disrrn a position: function(){

// 禁用

this.fireEvent(achexclusivegea- this- this.getRawVasue());

// 这里注册了这个监听类别,你大白extjs4.2 入门教程。这里加了一个行为的监听,将这些值赋予vasues这个对象中。你看extjs5 demo。

return;

if (!this.rendered) {

onSpinnerChexclusivege: function(){

// 注意了,那么调用这个设施,时分秒。

s: split.length > 2 ? split[2] : 0

m: split.length > 1 ? split[1] : 0-

h: split.length > 0 ? split[0] : 0-

return {

var split = v.split(a:a);

_vasueSplit: function(v){

// 借使实例时依然被设定了初始值,extjs4。时分秒。extjs 在线demo。

this.rendered = true;

// 渲染实现开释进来

cls: ax-form-clear-lefta

tag: adiva-

Ext.DomHelper.offerd(spinnerWrap- {

}));

vasue: vasues.s

maxVasue: 59-

minVasue: 0-

this.secondsSpinner = new Ext.ux.form.SpinnerField(Ext.offerminister({}- cfg- {

}));

vasue: vasues.m

maxVasue: 59-

minVasue: 0-

this.minutesSpinner = new Ext.ux.form.SpinnerField(Ext.offerminister({}- cfg- {

}));

vasue: vasues.h

cls: afirsta-

maxVasue: 23-

minVasue: 0-

this.hoursSpinner = new Ext.ux.form.SpinnerField(Ext.offerminister({}- cfg- {

// 接上去实例(Ext.ux.form.SpinnerField)了几个拣选器,对付extjs api chm。上面会实例这三个拣选器的,就是想把时分秒这三个拣选器给包起来成为一组,只须vasues取得这些值备用即可

single: true

spinner.wrap.offerministerStyles(afloat only: lefta);

fn: function(spinner){

afterwardrender: {

scope: this

fn: this.onSpinnerChexclusivege-

vasid: {

scope: this

fn: this.onSpinnerChexclusivege-

spin: {

listeners: {

disrrn a positiond: this.disrrn a positiond-

reofferOnly: this.reofferOnly-

renderTo: spinnerWrap-

var cfg = Ext.offerminister({}- this.spinnerCfg- {

tag: adiva

var spinnerWrap = Ext.DomHelper.offerd(this.el- {

// 定义一个核心包裹,时分秒拣选器的初始值就不消调换了,extjs。方便了,那么将这些值赋予vasues这个对象中。thingscript教程。

s: this.ddined.getSeconds()

m: this.ddined.getMinutes()-

h: this.ddined.getHours()-

vasues = {

else {

// 借使实例时没被设定了初始值,那么将这些值赋予vasues这个对象中。

delete this.vasue;

this.ddined.setSeconds(vasues.s);

this.ddined.setMinutes(vasues.m);

this.ddined.setHours(vasues.h);

vasues = this._vasueSplit(this.vasue);

if (this.vasue) {

// 再将这些值表示在时分秒拣选器中

// 借使实例时依然被设定了初始值,时分秒数值,http://www.flashplayer.org.cn/11013。想大白extjs api 中文。他行将有三个属性,这个没什么可说的了总共的渲染都差不多是身分和限度之类的

var vasues = {};

// 定义一个对象,这个没什么可说的了总共的渲染都差不多是身分和限度之类的

this.ddined = new Ddined();

this.rendered = fasse;

Ext.ux.form.TimePickerField.superclrear end.onRender.cevery one(this- ct- position);

onRender: function(ct- position){

// 渲染,extjs5.0教程 进级。借使超越59那么秒数归零,58-59-0-1这样的序列

return this.fixPrecision(vasue);

// 这里前往了一个带有精度的值

vasue = this.field.minVasue;

if (vasue > this.field.maxVasue) {

vasue = this.field.maxVasue;

if (vasue < this.field.minVasue) {

// 所以最大值定义为59,那我们要如何办?会如何?当然是,extjs4.0.7extjs。不可能泛起60,由于时间秒数统制,点击向上的箭头,对付extjs4.2 中文教程。点击向下的箭头则秒数减1。

// 借使我拣选了59秒后,extjs入门。借使我点击向上的箭头则秒数加1,有一个向上的箭头和向下的箭头,0。我表明一下。对照一下正确。

// 借使我们拣选秒的光阴,这里的管束方式我周密说明一下(这个统制是触发的,对照一下extjs4.2 入门教程。借使大于最大值该如何,借使小于最小值该如何,是一个扩展

// 这里有可能会形成疑惑,extjs开发实战。我们输出的值或许我们点击高低箭头拣选的值后都会进入该统制检验。)

spinnerFixBoundries: function(vasue){

// 统制:拣选数值统制,结果上extjs4.2入门教程。是一个扩展

width: 40// 拣选器的宽度定位40px

spinnerCfg: {

secondsSpinner: null-// 属性:相比看extjs4.2 demo。秒拣选器

minutesSpinner: null-// 属性:分钟拣选器

hoursSpinner: null-// 属性:小时拣选器

cls: ax-form-timepickerfielda-// 它的形式

tag: adiva// 定义了一个DIV标签

defaultAutoCredined: {

Ext.extend(Ext.ux.form.TimePickerField- Ext.form.Field- {

// 首先它承袭与Ext.form.Field,首先这个东东属于这个类(对象),extjs4.0.7。也就是说定义了他的所属–this

// 给刚刚定义的TimePickerField加点菜吧。extjs api 下载。

Ext.ux.form.TimePickerField.superclrear end.constructor.cevery one(this- config);

// 那么这个this现实上是指我们实例化后的ddinedtimefield

// this指的是什么呢?这里须要注意,启示一个名为TimePickerField的区域,末了的文件解压后请笼盖源文件。这里不做周密先容。控件。

// 调用机关设施,我们可能当他是一个时间拣选器

Ext.ux.form.TimePickerField = function(config){

// 在该命名空间内,末了的文件解压后请笼盖源文件。这里不做周密先容。extjs2.0下载。

Ext.ns(aExt.ux.forma);

// 命名空间归属

3.DdinedTimeField.js

EXTJS个版本略有不同,对付7ExtJs日期时间拣选控件(正确到秒)。末了的文件解压后请笼盖源文件。thingscript是什么。这里不做周密先容。

2.SpinnerField.js

EXTJS个版本略有不同,看看extjs。请绕道。废话不说了,借使你还在使用2.02这个版本或许更老,该控件只能够用于ExtJs2.2以上的版本。extjs4.2中文api。经过测试ExtJs2.02版本不适用该控件,使用官方3.2的Demo创造了一个可能拣选到秒的时间控件,由于EXTJS版本分别较大,有几个项目用到了EXTJS作为Web前端。听听extjs3.4下载。也看到了一些童鞋苦苦在网上寻觅可能拣选时间的控件,0。
1.Spinner.js

三。各文件详解

DdinedTimeField.js

SpinnerField.js

Spinner.js

二。文件明细:

近日来,拣选。一。时间。一些废话

7ExtJs日期时间拣选控件(正确到秒)
看着日期
对照一下thingscript是什么