ExtJs 입문부터 숙달까지 (2)

3343 단어 ExtJs
1. Ext.Ajax  (extends Connection)
 
				Ext.Ajax.on("requestcomplete", function(_conn, _response,
								_options) {
							alert(_response.responseXML.xml);
						});
				Ext.Ajax.request({
							url : "http://localhost:8080/extjs/servlet/TestServlet",
							params : {
								name : "aaa",
								sex : "bbb"
							}
						})

 
_response.responseText
 
method: get post
 
매개 변수는 xml 형식의 데이터일 수도 있습니다
    Ext.Ajax.request({       url : "http://localhost:8080/extjs/servlet/TestServlet ",       method : "post",                                   xmlData: ""      });
 
Json 데이터 형식
    Ext.Ajax.request({       //dataType : "json",       url : "http://localhost:8080/extjs/servlet/TestServlet ",       method : "post",       jsonData : {name:"name",sex:"sex"}      });
 
2. Ext.data.Connection (extends Connection)
 
 
Ext.onReady(function() {
	var _window = new Ext.Window({
		title : " ",
		frame : true,
		width : 500,
		height : 400,
		// layout : "form",
		plain : true,
		resizable : false,
		bodyStyle : "padding:3px",
		labelWidth : 45,
		minimizable : false,
		maximizable : false,
		closable : true,
		closeAction : "hide",
		buttonAlign : "left",
		items : [{
					baseCls : "x-plain",
					style : "padding:5px",
					layout : "column",
					items : [{
								columnWidth : .5,
								layout : "form",
								labelWidth : 55,
								defaults : {
									width : 160
								},
								baseCls : "x-plain",
								defaultType : "textfield",
								items : [{
											layout : "form",
											hideLabel : false,
											fieldLable : " "
										}]
							}, {
								columnWidth : .5,
								layout : "form",
								labelWidth : 55,
								baseCls : "x-plain",
								items : {
									xtype : "textfield",
									fieldLable : " ",
									width : 170,
									height : 177,
									inputType : "image"
								}
							}]
				}],
		showLock : false,
		listeners : {
			"show" : function(_window) {
				if (_window["showLock"]) {
					_window.findByType("textfiled")[7].getEl().dom.src = "xxx.gif";
					showLock = true;
				}
			}
		}
	});
	_window.show();
});

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

좋은 웹페이지 즐겨찾기