主要是为了给自己做总结的,所以只贴了代码,如果有看不懂的还是请参照ExtJs3.0 的Example吧
Accordion 上下,帘子效果
Ext.onReady(function() {
var item1 = new Ext.Panel({
title: 'Accordion Item 1',
html: '<empty panel>',
cls:'empty'
});
var item2 = new Ext.Panel({
title: 'Accordion Item 2',
html: '<empty panel>',
cls:'empty'
});
var item3 = new Ext.Panel({
title: 'Accordion Item 3',
html: '<empty panel>',
cls:'empty'
});
var item4 = new Ext.Panel({
title: 'Accordion Item 4',
html: '<empty panel>',
cls:'empty'
});
var item5 = new Ext.Panel({
title: 'Accordion Item 5',
html: '<empty panel>',
cls:'empty'
});
var accordion = new Ext.Panel({
region:'west',
margins:'5 0 5 5',
split:true,
width: 210,
layout:'accordion',
items: [item1, item2, item3, item4, item5]
});
var viewport = new Ext.Viewport({
layout:'border',
items:[
accordion, {
region:'center',
margins:'5 5 5 0',
cls:'empty',
bodyStyle:'background:#f1f1f1',
html:'<br/><br/><empty center panel>'
}]
});
});
Anchor 个人感觉不是很有用,负的和百分比来分
Ext.onReady(function() {
var viewport = new Ext.Viewport({
layout:'anchor',
anchorSize: {width:1024, height:600},
items:[{
title:'Item 1',
html:'Content 1',
width:800,
anchor:'right 20%'
},{
title:'Item 2',
html:'Content 2',
width:300,
anchor:'50% 30%'
},{
title:'Item 3',
html:'Content 3',
width:600,
anchor:'-100 50%'
}]
});
});
Column 以列为单位
var viewport = new Ext.Viewport({
layout:'border',
items:[{
region:'west',
id:'west-panel',
title:'West',
split:true,
width: 200,
minSize: 175,
maxSize: 400,
collapsible: true,
margins:'35 0 5 5',
cmargins:'35 5 5 5',
layout:'accordion',
layoutConfig:{
animate:true
},
items: [{
html: Ext.example.shortBogusMarkup,
title:'Navigation',
autoScroll:true,
border:false,
iconCls:'nav'
},{
title:'Settings',
html: Ext.example.shortBogusMarkup,
border:false,
autoScroll:true,
iconCls:'settings'
}]
},{
region:'center',
margins:'35 5 5 0',
layout:'column',
autoScroll:true,
items:[{
columnWidth:.33,
baseCls:'x-plain',
bodyStyle:'padding:5px 0 5px 5px',
items:[{
title: 'A Panel',
html: Ext.example.shortBogusMarkup
}]
},{
columnWidth:.33,
baseCls:'x-plain',
bodyStyle:'padding:5px 0 5px 5px',
items:[{
title: 'A Panel',
html: Ext.example.shortBogusMarkup
}]
},{
columnWidth:.33,
baseCls:'x-plain',
bodyStyle:'padding:5px',
items:[{
title: 'A Panel',
html: Ext.example.shortBogusMarkup
},{
title: 'Another Panel',
html: Ext.example.shortBogusMarkup
}]
}]
}]
});
});
Table 有点像合并单元格
Ext.onReady(function() {
var panel = new Ext.Panel({
id:'main-panel',
baseCls:'x-plain',
renderTo: Ext.getBody(),
layout:'table',
layoutConfig: {columns:3},
// applied to child components
defaults: {frame:true, width:200, height: 200},
items:[{
title:'Item 1'
},{
title:'Item 2'
},{
title:'Item 3'
},{
title:'Item 4',
width:410,
colspan:2
},{
title:'Item 5'
},{
title:'Item 6'
},{
title:'Item 7',
width:410,
colspan:2
},{
title:'Item 8'
}]
});
});
Vbox and hbox主要是按钮的排版和按钮加同行的排版
Form 表单比较简单
Fit 第一个顶掉其他的
Card 卡片式的,一次NEXT只有一个页面
Border 用的比较频繁,主要分为“东西南北中”
Absolute是自定义的,靠X,Y决定panel的位置
目前看到的好像就这么几个,用到再差文档吧!~
一个比较复杂的布局例子
Ext.onReady(function(){
// NOTE: This is an example showing simple state management. During development,
// it is generally best to disable state management as dynamically-generated ids
// can change across page loads, leading to unpredictable results. The developer
// should ensure that stable state ids are set for stateful components in real apps.
Ext.state.Manager.setProvider(new Ext.state.CookieProvider());
var viewport = new Ext.Viewport({
layout: 'border',
items: [
// create instance immediately
new Ext.BoxComponent({
region: 'north',
height: 32, // give north and south regions a height
autoEl: {
tag: 'div',
html:'<p>north - generally for menus, toolbars and/or advertisements</p>'
}
}), {
// lazily created panel (xtype:'panel' is default)
region: 'south',
contentEl: 'south',
split: true,
height: 100,
minSize: 100,
maxSize: 200,
collapsible: true,
title: 'South',
margins: '0 0 0 0'
}, {
region: 'east',
title: 'East Side',
collapsible: true,
split: true,
width: 225, // give east and west regions a width
minSize: 175,
maxSize: 400,
margins: '0 5 0 0',
layout: 'fit', // specify layout manager for items
items: // this TabPanel is wrapped by another Panel so the title will be applied
new Ext.TabPanel({
border: false, // already wrapped so don't add another border
activeTab: 1, // second tab initially active
tabPosition: 'bottom',
items: [{
html: '<p>A TabPanel component can be a region.</p>',
title: 'A Tab',
autoScroll: true
}, new Ext.grid.PropertyGrid({
title: 'Property Grid',
closable: true,
source: {
"(name)": "Properties Grid",
"grouping": false,
"autoFitColumns": true,
"productionQuality": false,
"created": new Date(Date.parse('10/15/2006')),
"tested": false,
"version": 0.01,
"borderWidth": 1
}
})]
})
}, {
region: 'west',
id: 'west-panel', // see Ext.getCmp() below
title: 'West',
split: true,
width: 200,
minSize: 175,
maxSize: 400,
collapsible: true,
margins: '0 0 0 5',
layout: {
type: 'accordion',
animate: true
},
items: [{
contentEl: 'west',
title: 'Navigation',
border: false,
iconCls: 'nav' // see the HEAD section for style used
}, {
title: 'Settings',
html: '<p>Some settings in here.</p>',
border: false,
iconCls: 'settings'
}]
},
// in this instance the TabPanel is not wrapped by another panel
// since no title is needed, this Panel is added directly
// as a Container
new Ext.TabPanel({
region: 'center', // a center region is ALWAYS required for border layout
deferredRender: false,
activeTab: 0, // first tab initially active
items: [{
contentEl: 'center1',
title: 'Close Me',
closable: true,
autoScroll: true
}, {
contentEl: 'center2',
title: 'Center Panel',
autoScroll: true
}]
})]
});
// get a reference to the HTML element with id "hideit" and add a click listener to it
Ext.get("hideit").on('click', function(){
// get a reference to the Panel that was created with id = 'west-panel'
var w = Ext.getCmp('west-panel');
// expand or collapse that Panel based on its collapsed property state
w.collapsed ? w.expand() : w.collapse();
});
});
分享到:
相关推荐
3. **布局管理**:ExtJS支持多种布局方式,如表布局(Table Layout)、流式布局(Form Layout)、绝对布局(Absolute Layout)等,可以根据不同场景灵活选择,满足各种布局需求。 4. **Ajax和数据接口**:ExtJS内置...
"Extjs3.0中文文档大全"提供了全面的指南,帮助开发者深入理解和有效地利用这个版本的ExtJS。 文档可能包括以下几个关键部分: 1. **快速入门**:这部分通常会介绍如何在项目中引入ExtJS库,创建基本的页面结构,...
ExtJS 3.0中文API文档是对于这个版本的详细说明,帮助中国开发者理解和使用其各种功能。 首先,我们要理解API(Application Programming Interface)是什么。API是一组预定义的函数、类、对象和常量,允许开发人员...
这篇文档将详细介绍ExtJS 3.0的中文API,帮助开发者更好地理解和使用这个框架。 一、核心概念 1. 组件(Components):ExtJS的核心是组件化,它将页面元素封装为可重用的组件,如按钮、表格、面板等。每个组件都有...
在这个“extjs3.0例子”中,我们将深入探讨EXTJS的核心概念、常用对象及其使用方法。 EXTJS的核心在于它的组件模型,其中包括窗口(Window)、面板(Panel)、表格(Grid)、表单(Form)、菜单(Menu)等。这些...
### ExtDesigner for extjs3.0 使用帮助文档 #### Introduction ExtJs3.0是一款卓越的JavaScript框架,它以其强大的功能、丰富的组件库以及对JSON数据格式的支持而著称。尽管如此,对于开发者来说,掌握所有组件的...
3. **布局管理器(Layout Manager)**:ExtJS的布局管理器允许你为容器定义不同的布局方式,如表格布局(Table Layout)、绝对布局(Absolute Layout)、流式布局(Form Layout)等,确保组件在容器中正确排列和大小...
We are releasing a Designer Preview that will allow you to experiment with the designer interface and to explore how configs affect your layout. Soon, you will be able to build your application ...
在 ExtJS4 中,API 也发生了很大的变化,包括 tree、tab panel、grid、window、form、chart、data stores、border layout 等等。这些变化使得大型应用程序迁移变得非常困难。 在 ExtJS3 中,我们可以使用 Ext....
ExtJS提供了多种布局策略,如边框布局(Border Layout)、卡片布局(Card Layout)等,方便开发者灵活安排页面元素的显示方式。 ### 1.4 ExtJS的开发环境与工具 ExtJS的开发不仅依赖于良好的编码习惯,还需要一...
《Ext3.0最经典的学习教程》深入浅出地介绍了ExtJS的核心概念和技术细节,对于希望利用ExtJS构建高效、美观的Web应用程序的开发者来说,是一份不可或缺的参考资料。通过学习和实践这些知识点,开发者将能够更好地...
2. **ExtJS 3.x API**: 3.0版本是一个重要的里程碑,增强了组件库,增加了许多新的控件,如TabPanel、AccordionLayout等。还引入了Ajax proxy,改进了数据处理,并对性能进行了优化。3.x系列是ExtJS广泛使用的版本之...
Ext3.0框架中的图表是基于Flash技术的...由于ExtJS3.0的文档对图表部分可能不够全面,建议开发者结合YUI的图表文档进行深入学习和实践。通过熟练掌握这些配置,你可以构建出交互性强、视觉效果良好的数据可视化应用。
<ext:FormPanel id="uploadForm" width="400" layout="form"> 文件名" name="filename"> 选择文件" name="file"/> 上传" handler="uploadFile"> ``` 在上述代码中,我们创建了一个表单,包含一个文本字段...
1. **布局类**:包括容器布局(Container Layout)、绝对定位布局(Absolute Layout)、手风琴布局(Accordion)、锚点布局(Anchor Layout)、边框布局(Border Layout)、卡片布局(Card Layout)、列布局(Column Layout)、...
同时,ExtJS的布局管理器(Layout Manager)使得页面元素可以根据屏幕大小动态调整,提供良好的响应式设计。 提及的后端技术C#和ASP.NET是微软的.NET框架下的开发语言和Web开发平台。C#是一种面向对象的编程语言,...
4. **布局管理**:`Ext.layout`包含各种布局管理器,如`Ext.layout.container.Fit`和`Ext.layout.container.Border`,它们负责计算和调整组件的大小和位置。 5. **AJAX通信**:`Ext.Ajax`提供了与服务器交互的接口...
+添加对extjs3.0中所有语言的支持。 -ExtAspNet扩展的多语言包在js\languages\extaspnet目录下,目前只有en,zh_CN,zh_TW三种实现 -你可以向其中添加自己的语言版本,并执行js\languages下的pack.bat打包,最后...
+添加对extjs3.0中所有语言的支持。 -ExtAspNet扩展的多语言包在js\languages\extaspnet目录下,目前只有en,zh_CN,zh_TW三种实现 -你可以向其中添加自己的语言版本,并执行js\languages下的pack.bat打包,最后...