Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
adv-vtypes.js
Package: ext-3.1.0.zip [view]
Upload User: dawnssy
Upload Date: 2022-08-06
Package Size: 9345k
Code Size: 3k
Category:
JavaScript
Development Platform:
JavaScript
- /*! * Ext JS Library 3.1.0 * Copyright(c) 2006-2009 Ext JS, LLC * licensing@extjs.com * http://www.extjs.com/license */ // Add the additional 'advanced' VTypes
- 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.getTime()))) {
- var start = Ext.getCmp(field.startDateField);
- start.setMaxValue(date);
- start.validate();
- this.dateRangeMax = date;
- }
- else if (field.endDateField && (!this.dateRangeMin || (date.getTime() != this.dateRangeMin.getTime()))) {
- var end = Ext.getCmp(field.endDateField);
- end.setMinValue(date);
- end.validate();
- this.dateRangeMin = date;
- }
- /*
- * Always return true since we're only using this vtype to set the
- * min/max allowed values (these are tested for after the vtype test)
- */
- return true;
- },
- password : function(val, field) {
- if (field.initialPassField) {
- var pwd = Ext.getCmp(field.initialPassField);
- return (val == pwd.getValue());
- }
- return true;
- },
- passwordText : 'Passwords do not match'
- });
- Ext.onReady(function(){
- Ext.QuickTips.init();
- // turn on validation errors beside the field globally
- Ext.form.Field.prototype.msgTarget = 'side';
- var bd = Ext.getBody();
- /*
- * ================ Date Range =======================
- */
- var dr = new Ext.FormPanel({
- labelWidth: 125,
- frame: true,
- title: 'Date Range',
- bodyStyle:'padding:5px 5px 0',
- width: 350,
- defaults: {width: 175},
- defaultType: 'datefield',
- items: [{
- fieldLabel: 'Start Date',
- name: 'startdt',
- id: 'startdt',
- vtype: 'daterange',
- endDateField: 'enddt' // id of the end date field
- },{
- fieldLabel: 'End Date',
- name: 'enddt',
- id: 'enddt',
- vtype: 'daterange',
- startDateField: 'startdt' // id of the start date field
- }]
- });
- dr.render('dr');
- /*
- * ================ Password Verification =======================
- */
- var pwd = new Ext.FormPanel({
- labelWidth: 125,
- frame: true,
- title: 'Password Verification',
- bodyStyle:'padding:5px 5px 0',
- width: 350,
- defaults: {
- width: 175,
- inputType: 'password'
- },
- defaultType: 'textfield',
- items: [{
- fieldLabel: 'Password',
- name: 'pass',
- id: 'pass'
- },{
- fieldLabel: 'Confirm Password',
- name: 'pass-cfrm',
- vtype: 'password',
- initialPassField: 'pass' // id of the initial password field
- }]
- });
- pwd.render('pw');
- });