extjs panel拖动

阅读更多
Ext.onReady(
	function() {
		new Ext.Panel(
		{
			renderTo:hello,
			width:400,
			height:300,
			title:"我是Panel",
			html:"",
			autoScroll:true,
			collapsible:true,
			tbar:[{text:"顶部按钮1",handler:function(){ Ext.MessageBox.alert("点击","顶部按钮1被点击")}{text:"顶部按钮2"}],
			bbar:[{text:"底部按钮1"},{text:"底部按钮2"}],
			draggable:{
				insertProxy:false,
				onDrag:function(e){
					var pel = this.proxy.getEl();
					this.x = pel.getLeft(true);
					this.y = pel.getTop(true);
					var s = this.panel.getEl().shadow;
					s.hide();
				},
				endDrag:function(e) {
					this.panel.setPosition(this.x,this.y);
				}
			},
			x:100,
			y:100,
			floating:true
		}
		);
	}
);

你可能感兴趣的:(extjs)