zoukankan
html css js c++ java
ext 2.0 渲染HTML表单 (含中文版日期选单控件)
<!
DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
>
<
html
>
<
head
>
<
title
>
ext form render
</
title
>
<
link
rel
='stylesheet'
href
='ext-all.css'
>
<
style
type
='text/css'
>
.x-form-field-wrap
{
}
{
display
:
inline
;
}
/**/
/*
display DateFields inline
*/
.x-form-field-wrap .x-form-date-trigger-nonie
{
}
{
top
:
-1px
;
}
/**/
/*
remove 1px top padding for non-IE browsers
*/
</
style
>
<
link
rel
="stylesheet"
type
="text/css"
href
="framework/ext-2.0.2/resources/css/ext-all.css"
/>
<
script
type
="text/javascript"
src
="framework/ext-2.0.2/adapter/ext/ext-base.js"
></
script
>
<
script
type
="text/javascript"
src
="framework/ext-2.0.2/ext-all.js"
></
script
>
<
script
type
="text/javascript"
src
='framework/ext-2.0.2/adapter/yui-utilities.js'
></
script
>
</
head
>
<
body
>
<
div
class
="x-box-tl"
>
<
div
class
="x-box-tr"
>
<
div
class
="x-box-tc"
></
div
>
</
div
>
</
div
>
<
div
class
="x-box-ml"
>
<
div
class
="x-box-mr"
>
<
div
class
="x-box-mc"
>
<
form
id
="form2"
method
="post"
>
<
h3
>
表单范例
</
h3
>
<
table
>
<
tr
>
<
td
class
="title"
>
文字输入:
</
td
>
<
td
style
="font-family: verdana;"
><
input
type
="text"
id
="tf"
name
="text2"
/></
td
>
</
tr
>
<
tr
>
<
td
class
="title"
>
下拉选单:
</
td
>
<
td
style
="font-family: verdana;"
><
select
id
="cb"
name
="st2"
>
<
option
></
option
>
<
option
>
Aeiou
</
option
>
<
option
>
Andy
</
option
>
<
option
>
Amy
</
option
>
<
option
>
Aloha
</
option
>
<
option
>
Apple
</
option
>
<
option
>
Application
</
option
>
<
option
>
Aprik
</
option
>
<
option
>
Backup
</
option
>
<
option
>
Book
</
option
>
</
select
></
td
>
</
tr
>
<
tr
>
<
td
class
="title"
>
日期选择:
</
td
>
<
td
style
="font-family: verdana;"
><
input
type
="text"
id
="df"
name
="df"
/></
td
>
</
tr
>
<
tr
>
<
td
class
="title"
>
多行输入:
</
td
>
<
td
><
textarea
id
="ta2"
name
="ta"
cols
="50"
rows
="6"
></
textarea
></
td
>
</
tr
>
<
tr
>
<
td
class
="title"
></
td
>
<
td
>
<
div
id
="btn"
></
div
>
</
td
>
</
tr
>
</
table
>
</
form
>
</
div
>
</
div
>
</
div
>
<
div
class
="x-box-bl"
>
<
div
class
="x-box-br"
>
<
div
class
="x-box-bc"
></
div
>
</
div
>
</
div
>
</
body
>
</
html
>
<
script
type
='text/javascript'
>
Ext.onReady(
function
()
{
//
定义表单
userForm
=
new
Ext.form.BasicForm(
'
form2
'
);
//
渲染输入框
var
tf
=
new
Ext.form.TextField(
{
applyTo:
'
tf
'
,
id:
'
tf
'
,
allowBlank:
false
,
340
}
);
//
渲染下拉框
var
cb
=
new
Ext.form.ComboBox(
{
transform:
'
cb
'
}
);
//
渲染日历框
var
df
=
new
Ext.form.DateField(
{
applyTo:
'
df
'
,
timePicker:
true
}
);
//
渲染文本域
var
ta
=
new
Ext.form.TextArea(
{
applyTo:
'
ta
'
}
);
var
btn
=
new
Ext.Button(
{
applyTo:
'
btn
'
,
text:
'
提交
'
}
);
userForm.add(tf);
userForm.add(df);
userForm.add(cb);
//
覆写日历
Date.dayNames
=
[
"
日
"
,
"
一
"
,
"
二
"
,
"
三
"
,
"
四
"
,
"
五
"
,
"
六
"
];
if
(Ext.DatePicker)
{
Ext.apply(Ext.DatePicker.prototype,
{
todayText:
"
今天
"
,
minText:
"
日期在最小日期之前
"
,
maxText:
"
日期在最大日期之后
"
,
disabledDaysText:
""
,
disabledDatesText:
""
,
monthNames: Date.monthNames,
dayNames: Date.dayNames,
nextText:
'
下月 (Control+Right)
'
,
prevText:
'
上月 (Control+Left)
'
,
monthYearText:
'
选择一个月 (Control+Up/Down 来改变年)
'
,
todayTip:
"
{0} (Spacebar)
"
,
okText:
"
确定
"
,
cancelText:
"
取消
"
,
format:
"
y年m月d日
"
}
);
}
}
);
</
script
>
查看全文
相关阅读:
用AjaxMethod 方法实现动态加载地图
C#中HashTable的使用(转)
ArcGIS Server 中的动态文字标注
ArcGIS Server .Net Web ADF之几何类型的相互转换(转)
ArcGIS Server连接远程地图服务器
sqlplus环境配置(login.sql)
Oracle从软件安装到运行的全流程
【转载】linux中误删除oracle数据文件的恢复操作
“大淘宝战略”下集市定位,将决定马云和未来淘宝的命运
男人如何对待抱怨自己的女人
原文地址:https://www.cnblogs.com/meetrice/p/1206027.html
最新文章
iTextSharp 使用详解
动感相册源码类似QQ动感影集.rar
PHP+mysql乱码问题
C# sealed关键字
的电脑打开网页总是提示“Adobe?flash?player安装失败,请访问 http://www.adobe.com/go/tn_19166_cn”。进不了提示的网站
C++摘抄
Start, codename: Lachesis
想更新一些设备
最近在攻略的游戏
杀毒软件
热门文章
乱写的
看书真爽
MMX编程(续)
删除隐藏的硬件
十瀑峡游记
常用正则表达式(转)
oracle建立触发器
Ajax and WebGIS
ArcGIS Server操作Mxd文件(转)
ArcGIS Server 中画点、线、多边形、圆等的重要代码
Copyright © 2011-2022 走看看