1 use Cache Var such as
detailE1
2 use Class
contentPanel
default contains all the items such as below:
items:[
//from basic.js
start,absolute,accordion,anchor,border,cardTabs,cardWizard,column,fit,form,table,
//form custom.js
rowLayout,centerLayout,
//from combination.js
absoluteForm,tabsNsetedLayouts
]
treePanel
use “
loader:new Ext.tree.TreeLoader ({dataUrl:'tree-date.json'})” property the load the data
detailsPanel
3 use Viewport to contain all the panels
items:[treePanel,detailsPanel]
4 use treePanel.on('click',function(n){...}) to deal the event
in event handle:
use Ext.getCmp('content-panel').layout.setActiveItem(n.id+'-panel') to active the selected Item
use detailE1.hide().update(Ext.getDom(n.id+'-details').innerHTML).slideIn('1',{stopFx:true,duration:.2})
to show the notes of the treeNode.
类的定义
Employee = function(name){
- this.name = name;
- this.addEvents({
- "fired" : true,
- "quit" : true
- });
- }
各控件的定义
如 arv={
id: ..
title: ..
layout: ..
xtype: see below
items: [ json,json2,... ]};
All visual widgets that require rendering into a layout should subclass Component (or Ext.BoxComponent if managed
box model handling is required).
Every component has a specific
xtype, which is its Ext-specific type name, along with methods for checking the
xtype like getXType and isXType. This is the list of all valid xtypes:
- xtype Class
- ------------- ------------------
- box Ext.BoxComponent
- button Ext.Button
- colorpalette Ext.ColorPalette
- component Ext.Component
- container Ext.Container
- cycle Ext.CycleButton
- dataview Ext.DataView
- datepicker Ext.DatePicker
- editor Ext.Editor
- editorgrid Ext.grid.EditorGridPanel
- grid Ext.grid.GridPanel
- paging Ext.PagingToolbar
- panel Ext.Panel
- progress Ext.ProgressBar
- propertygrid Ext.grid.PropertyGrid
- slider Ext.Slider
- splitbutton Ext.SplitButton
- statusbar Ext.StatusBar
- tabpanel Ext.TabPanel
- treepanel Ext.tree.TreePanel
- viewport Ext.Viewport
- window Ext.Window
- Toolbar components
- ---------------------------------------
- toolbar Ext.Toolbar
- tbbutton Ext.Toolbar.Button
- tbfill Ext.Toolbar.Fill
- tbitem Ext.Toolbar.Item
- tbseparator Ext.Toolbar.Separator
- tbspacer Ext.Toolbar.Spacer
- tbsplit Ext.Toolbar.SplitButton
- tbtext Ext.Toolbar.TextItem
-
- Form components
- ---------------------------------------
- form Ext.FormPanel
- checkbox Ext.form.Checkbox
- combo Ext.form.ComboBox
- datefield Ext.form.DateField
- field Ext.form.Field
- fieldset Ext.form.FieldSet
- hidden Ext.form.Hidden
- htmleditor Ext.form.HtmlEditor
- label Ext.form.Label
- numberfield Ext.form.NumberField
- radio Ext.form.Radio
- textarea Ext.form.TextArea
- textfield Ext.form.TextField
- timefield Ext.form.TimeField
- trigger Ext.form.TriggerField
//显式创建所容纳的组件
var panel = new Ext.Panel({
...
items: [
new Ext.Button({
text: 'OK'
})
]
};
//使用xtype创建
var panel = new Ext.Panel({
...
items: [{
xtype: 'button',
text: 'OK'
}]
};
第一个例子中,面板初始化的同时,按钮总是会立即被创建的。如果加入较多的组件,这种方法很可能界面的渲染速度。第二例子中,按钮直到面板真正在浏览器上显示才会被创建和渲染。
如果面板从未显示(例如有个tab一直是隐藏的),那么按钮就不会被创建,不会消耗任何资源了。
posted on 2008-11-25 10:07
桂湖山 阅读(1420)
评论(1) 编辑 收藏 引用 所属分类:
jsp页面技术