2008-05-07

Extjs2.0常用备忘

关键字: extjs2.0常用备忘
继承关系:Component--->BoxComponent---->Container----->Panel---各种具体Panel

1.MessageBox
Ext.MessageBox.alert("ok");


   Ext.Msg.show({
	   title:'Save Changes?',
	   msg: 'You are closing a tab that has unsaved changes. Would you like to save your changes?',
	   //值只能为MessageBox里Public Properties中的Button config
	   buttons: Ext.Msg.YESNOCANCEL,
	   //fn为回调
//	   fn: processResult,
	   animEl: 'elId',
	   //值只能为:值只能为MessageBox里Public Properties中的The CSS class
	   icon: Ext.MessageBox.WARNING
	});


2.布局处理Viewport
  	  var viewport = new Ext.Viewport({
  	     id:'desk',
  	     layout:'border',
  	     items:[{region:'north',height:50},{region:'west',width:200},{region:'center'}]
  	    }	
  	  		
  	  );


3.Panel
  	var panel = new Ext.Panel({
//  	        renderTo:'hello'可以替换掉panel.render("hello");
  	    id:'hello',
  	    title:'panlehell',
  	    width:200,
  	    height:200
  		
  	});
  	panel.render("hello");



4.TabPanel
 var tabPanel = new Ext.TabPanel({
    	    renderTo:'hello',
    	    activeTab: 0,
    		width:200,
    		height:200,
    		items:[
    		{title:'hello1',html:'hello1 content!'},//默认是Panel
    		new Ext.Panel({title:'hello2',html:'hello2 content'}),
    		new Ext.tree.TreePanel(  {title:'树面板',loader:new Ext.tree.TreeLoader(),root:new Ext.tree.AsyncTreeNode( {text:'根节点',children:[ { leaf:true,text:'叶子1' }, { leaf:true,text:'叶子2' } ]  } )  }  ),
    		  {xtype:'treepanel',title:'树面板',loader:new Ext.tree.TreeLoader(),root:new Ext.tree.AsyncTreeNode( {text:'根节点',children:[ { leaf:true,text:'叶子1' }, { leaf:true,text:'叶子2' } ]  } )  }  
    		]
    	}
    );
评论
发表评论

您还没有登录,请登录后发表评论

ttitfly
搜索本博客
我的相册
63e97aa5-d2de-33be-88c3-8f39d5279b8d-thumb
bbbb
共 3 张
存档
最新评论