`
kimmking
  • 浏览: 537772 次
  • 性别: Icon_minigender_1
  • 来自: 中华大丈夫学院
社区版块
存档分类
最新评论

文本框和combo,日期为什么对不齐呢?

阅读更多
var panel = new Ext.FormPanel({

		region : 'center',
		collapsible : true,
		labelAlign : 'left',
		autoScroll : true,

		labelWidth : 75,
		labelPad : 0,
		frame : true,
		title : '网上银行',
		bodyStyle : 'padding:5px 5px 0',
		width : 350,
		defaults : {
			width : 150
		},
		defaultType : 'textfield',
		items : [{
			fieldLabel : '开户行',
			name : 'orgbank',
			allowBlank : false,
			width : 150,
			blankText : '请填写你的开户行'
		}, new Ext.form.Field({

			fieldLabel : '账  号',
			allowBlank : false,
			width : 150,
			name : 'credit'
		}), new Ext.form.ComboBox({
			fieldLabel : '计划类别',
			store : new Ext.data.SimpleStore({
				fields : ['plansort'],
				data : [['正式'], ['追加']]
			}),
			width : 150,
			triggerAction : 'all',
			mode : 'local',
			displayField : 'plansort',
			value : '正式',
			editable : false
		}), new Ext.form.DateField({
			fieldLabel : '申请日期',
			format : 'Y-m-d',
			width : 150
		})],
		buttons : [{
			text : '提交',
			type : 'submit',
			handler : function() {

				//

				var obj = {
					url : 'Login',
					params : {
						username : 'Kimm King',
						password : 'asdfd'
					},
					method : 'post',
					success : function(result, request) {

						var obj = Ext.decode(result.responseText);
						Ext.Msg.alert('success', obj.Msg);
					},
					failure : function(result, request) {

						var obj = Ext.decode(result.responseText);
						Ext.Msg.alert('failure', obj.Msg);

					}
				};
				Ext.Ajax.request(obj);

				//

			}
		}, {
			text : '取 消',
			handler : function() {
				panel.form.reset();
			}
		}],
		renderTo : 'testaction'
	});
  • 大小: 29.2 KB
分享到:
评论
3 楼 chxkyy 2008-06-27  
我用的是Ext JS Library 2.0 Beta 1
页面文件:
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title></title>
		<script type="text/javascript" src="../adapter/yui/yui-utilities.js"></script>
		<script type="text/javascript" src="../adapter/yui/ext-yui-adapter.js"></script>
		<script type="text/javascript" src="../ext-all-debug.js"></script>
		<script type="text/javascript" src="../ext-lang-zh_CN.js"></script>

		<script type="text/javascript" src="a.js"></script>
		<!-- Include Ext stylesheets here: -->
		<link rel="stylesheet" type="text/css"
			href="../resources/css/ext-all.css" />
		<link rel="stylesheet" type="text/css" href="ExtMenu.css" />
	</head>
	<body>
		<div id="toolbar">
	</body>
</html>

Ext.onReady(
	function(){
		var panel = new Ext.FormPanel({
		region : 'center',
		collapsible : true,
		labelAlign : 'left',
		autoScroll : true,

		labelWidth : 75,
		labelPad : 0,
		frame : true,
		title : '网上银行',
		bodyStyle : 'padding:5px 5px 0',
		width : 350,
		defaults : {
			width : 150
		},
		defaultType : 'textfield',
		items : [{
			fieldLabel : '开户行',
			name : 'orgbank',
			allowBlank : false,
			width : 150,
			blankText : '请填写你的开户行'
		}, new Ext.form.Field({

			fieldLabel : '账  号',
			allowBlank : false,
			width : 150,
			name : 'credit'
		}), new Ext.form.ComboBox({
			fieldLabel : '计划类别',
			store : new Ext.data.SimpleStore({
				fields : ['plansort'],
				data : [['正式'], ['追加']]
			}),
			width : 150,
			triggerAction : 'all',
			mode : 'local',
			displayField : 'plansort',
			value : '正式',
			editable : false
		}), new Ext.form.DateField({
			fieldLabel : '申请日期',
			format : 'Y-m-d',
			width : 150
		})],
		buttons : [{
			text : '提交',
			type : 'submit',
			handler : function() {

				//

				var obj = {
					url : 'Login',
					params : {
						username : 'Kimm King',
						password : 'asdfd'
					},
					method : 'post',
					success : function(result, request) {

						var obj = Ext.decode(result.responseText);
						Ext.Msg.alert('success', obj.Msg);
					},
					failure : function(result, request) {

						var obj = Ext.decode(result.responseText);
						Ext.Msg.alert('failure', obj.Msg);

					}
				};
				Ext.Ajax.request(obj);

				//

			}
		}, {
			text : '取 消',
			handler : function() {
				panel.form.reset();
			}
		}],
		renderTo : 'toolbar'
	});
	}
);

都是正常的。

2 楼 kimmking 2008-06-27  
ie7....
1 楼 chxkyy 2008-06-26  
你用的是什么浏览器?我用ie6,firefox 3 都正常的。

相关推荐

Global site tag (gtag.js) - Google Analytics