EXTJS请教!!! 本帖最后由 qiangyuzhihu 于 2011-04-21 15:52:07 编辑 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 才写这么一点可怜的代码<script type="text/javascript">Ext.onReady(function (){ var panel=new Ext.TabPanel({ renderTo: Ext.getBody(), width:800, height:600, activeTab:0, items: [new Ext.Panel({ title:"Cart Operate(CMC100)", height:30, html:'' }),new Ext.Panel({ title:"Consume Recodes(CMC106)", height:30, html:'' }),new Ext.Panel({ title:"Handset (CMC162)", height:30, html:'' })] });});</script> 其实没你想像中的那么难,嵌几个FieldSet就行了new Ext.form.FieldSet 思路:1.整体布局可以用tabPanel(标签式)或cardPanel(卡片式)2.如果是标签式比较简单,如果是卡片式需要在整体上再加三个按钮,分别用于打开对应panel。3.不管是标签还是卡片,整体panel都包含三个子panel。4.第一块内容用formPanel,包括fieldset,button,textfield等组合5.第二块内容用一个border布局的panel,中心为一个gridPanel,右边也可以是一个gridPanel。6.第三块内容跟第二块类似。7.第2、3块内容需要设置topToolBar。如果是我,我就选择tabPanel。难点:第二、三块内容的topToolBar。 第一张图,如何让FieldSet里面的那些控件比如Button,Textfield自左向右排列,而不是自上而下的排列呢?? 里面再用Ext.layout.ColumnLayout 布局就可以横向排列了 对照第一张图,做得很挫,但没办法了。有个下拉框,默认只有一个“COM3”且显示也是这个。不知道怎么实现啊! 代码有谁看下,烦请看看了!第2,3张还没做完!<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>CMC Consumption System Demo V1.0</title><link rel="stylesheet" type="text/css" href="../scripts/resources/css/ext-all.css"><script type="text/javascript" src="../scripts/ext-all.js"></script><script type="text/javascript" src="../scripts/ext-all-debug.js"></script><script type="text/javascript">Ext.onReady(function (){ var panel=new Ext.TabPanel({ renderTo: Ext.getBody(), width:800, height:600, activeTab:0, items: [new Ext.form.FormPanel({ title:"Cart Operate(CMC100)", height:30, frame: true, items: [new Ext.form.FieldSet({ height: 80, layout: 'table', items:[new Ext.form.Label({ text:'Port' }),new Ext.Button({ text:'Open', style:'margin-left: 30px', }),new Ext.Button({ text:'Colse', style:'margin-left: 10px' }),new Ext.form.Label({ text:'Please connect CMC100 first.', style:'margin-left: 10px' })] }),new Ext.form.FieldSet({ title: 'Init Card', height: 80, layout: 'table', items:[new Ext.Button({ text:'Init Card', style:'margin-left: 20px' }),new Ext.Button({ text:'Recycle', style:'margin-left: 90px' })] }),new Ext.form.FieldSet({ title: 'Read SN', height: 80, layout: 'table', items:[new Ext.Button({ text:'Read SN', style:'margin-left: 20px' }),new Ext.form.Label({ text:'SN:', style:'margin-left: 60px' }),new Ext.form.TextField({ name:'', style:'margin-left: 10px' })] }),new Ext.form.FieldSet({ title: 'Balance', height: 80, layout:'table', items:[new Ext.Button({ text:'Check Balance', style:'margin-left: 20px' }),new Ext.form.TextField({ name:'', style:'margin-left: 60px' }),new Ext.form.Label({ text:'(yuan)', style:'margin-left: 10px' })] }),new Ext.form.FieldSet({ title: 'Recharge', height: 80, layout:'table', items:[new Ext.form.Label({ text:'Please input amount', style:'margin-left: 20px' }),new Ext.form.TextField({ name: '', style:'margin-left: 90px' }),new Ext.form.Label({ text:'(yuan)', style:'margin-left: 10px' }),new Ext.Button({ text:'Recharge', style:'margin-left: 25px' })] }),new Ext.form.FieldSet({ title: 'Deduction', height: 80, layout:'table', items:[new Ext.form.Label({ text:'Please inout amount of deduction', style:'margin-left: 10px' }),new Ext.form.TextField({ name: '', style:'margin-left: 25px' }),new Ext.form.Label({ text:'(yuan)', style:'margin-left: 10px' }),new Ext.Button({ text:'Deduction', style:'margin-left: 25px' })] })] }),new Ext.Panel({ title:"Consume Recodes(CMC106)", height:30, html:'' }),new Ext.Panel({ title:"Handset (CMC162)", height:30, html:'' })] });});</script></head><body></body></html> 个人感觉用border布局比较好,如图: 第一张图在panel上面放个ToolBar,toolBar上面放个formPanel,formpanel使用layout:"column",横向布局把下拉框(oombo),按钮都丢上去,设置好宽度,慢慢调吧,多看下api中文Api3.0这里可以下到http://download.csdn.net/source/3201641 第一张图中:open按钮是可按的,其他按钮是灰色的。这个灰色怎么设置呢?new Ext.Button({ text:'Init Card', style:'margin-left: 20px', id:'init'这里面如何添加呢?还有按了open之后open按钮置灰,并且让其他按钮变成可按状态,如何实现啊??在open的handler中写Ext.getCmp('init').enable();貌似不管用啊!求教!!! 求教问题:new Ext.Button({ text:'Init Card', style:'margin-left: 20px', id:'init'如何让这个按钮置灰啊?还有open按钮按下以后使得open按钮本身置灰,并且让其他按钮处于可按状态我在它的handler里面写Ext.getCmp('init').enable();貌似不管用啊?咋实现呢?? 图片貌似失效了。我看不到了,早知道当时先down下来看的。 form里边嵌套form,如何实现流程完整无误通过? js匹配ip的正则式 请达人进来解决一下吧 关于file的过滤属性 muxrwc请进,其他朋友也可以过来帮忙,谢谢 [求助]求JavaScript判断文本域输入内容必须是数字代码 各位JS高手,帮忙看看,这种效果是怎么实现的,急用,多谢了, ~~~~~~~~~弹出窗口大小如何实现一致,马上给分!~~~~~~~~~~~ 在一个js文件中如何使用另外一个js文件中的函数? 怎样隐藏网易个人主页中的广告----属于嵌入<Script>语句。 跪求代码解释,被司徒正美雷倒了 setTimeout执行的问题
Ext.onReady(function (){
var panel=new Ext.TabPanel({
renderTo: Ext.getBody(),
width:800,
height:600,
activeTab:0,
items: [new Ext.Panel({
title:"Cart Operate(CMC100)",
height:30,
html:''
}),new Ext.Panel({
title:"Consume Recodes(CMC106)",
height:30,
html:''
}),new Ext.Panel({
title:"Handset (CMC162)",
height:30,
html:''
})]
});
});
</script>
new Ext.form.FieldSet
1.整体布局可以用tabPanel(标签式)或cardPanel(卡片式)
2.如果是标签式比较简单,如果是卡片式需要在整体上再加三个按钮,分别用于打开对应panel。
3.不管是标签还是卡片,整体panel都包含三个子panel。
4.第一块内容用formPanel,包括fieldset,button,textfield等组合
5.第二块内容用一个border布局的panel,中心为一个gridPanel,右边也可以是一个gridPanel。
6.第三块内容跟第二块类似。
7.第2、3块内容需要设置topToolBar。如果是我,我就选择tabPanel。
难点:第二、三块内容的topToolBar。
对照第一张图,做得很挫,但没办法了。有个下拉框,默认只有一个“COM3”且显示也是这个。不知道怎么实现啊!
第2,3张还没做完!
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>CMC Consumption System Demo V1.0</title>
<link rel="stylesheet" type="text/css" href="../scripts/resources/css/ext-all.css">
<script type="text/javascript" src="../scripts/ext-all.js"></script>
<script type="text/javascript" src="../scripts/ext-all-debug.js"></script>
<script type="text/javascript">
Ext.onReady(function (){
var panel=new Ext.TabPanel({
renderTo: Ext.getBody(),
width:800,
height:600,
activeTab:0,
items: [new Ext.form.FormPanel({
title:"Cart Operate(CMC100)",
height:30,
frame: true,
items: [new Ext.form.FieldSet({
height: 80,
layout: 'table',
items:[new Ext.form.Label({
text:'Port'
}),new Ext.Button({
text:'Open',
style:'margin-left: 30px',
}),new Ext.Button({
text:'Colse',
style:'margin-left: 10px'
}),new Ext.form.Label({
text:'Please connect CMC100 first.',
style:'margin-left: 10px'
})]
}),new Ext.form.FieldSet({
title: 'Init Card',
height: 80,
layout: 'table',
items:[new Ext.Button({
text:'Init Card',
style:'margin-left: 20px'
}),new Ext.Button({
text:'Recycle',
style:'margin-left: 90px'
})]
}),new Ext.form.FieldSet({
title: 'Read SN',
height: 80,
layout: 'table',
items:[new Ext.Button({
text:'Read SN',
style:'margin-left: 20px'
}),new Ext.form.Label({
text:'SN:',
style:'margin-left: 60px'
}),new Ext.form.TextField({
name:'',
style:'margin-left: 10px'
})]
}),new Ext.form.FieldSet({
title: 'Balance',
height: 80,
layout:'table',
items:[new Ext.Button({
text:'Check Balance',
style:'margin-left: 20px'
}),new Ext.form.TextField({
name:'',
style:'margin-left: 60px'
}),new Ext.form.Label({
text:'(yuan)',
style:'margin-left: 10px'
})]
}),new Ext.form.FieldSet({
title: 'Recharge',
height: 80,
layout:'table',
items:[new Ext.form.Label({
text:'Please input amount',
style:'margin-left: 20px'
}),new Ext.form.TextField({
name: '',
style:'margin-left: 90px'
}),new Ext.form.Label({
text:'(yuan)',
style:'margin-left: 10px'
}),new Ext.Button({
text:'Recharge',
style:'margin-left: 25px'
})]
}),new Ext.form.FieldSet({
title: 'Deduction',
height: 80,
layout:'table',
items:[new Ext.form.Label({
text:'Please inout amount of deduction',
style:'margin-left: 10px'
}),new Ext.form.TextField({
name: '',
style:'margin-left: 25px'
}),new Ext.form.Label({
text:'(yuan)',
style:'margin-left: 10px'
}),new Ext.Button({
text:'Deduction',
style:'margin-left: 25px'
})]
})]
}),new Ext.Panel({
title:"Consume Recodes(CMC106)",
height:30,
html:''
}),new Ext.Panel({
title:"Handset (CMC162)",
height:30,
html:''
})]
});
});
</script>
</head>
<body>
</body>
</html>
在panel上面放个ToolBar,toolBar上面放个formPanel,formpanel使用layout:"column",横向布局
把下拉框(oombo),按钮都丢上去,设置好宽度,慢慢调吧,多看下api
中文Api3.0这里可以下到
http://download.csdn.net/source/3201641
new Ext.Button({
text:'Init Card',
style:'margin-left: 20px',
id:'init'
这里面如何添加呢?还有按了open之后open按钮置灰,并且让其他按钮变成可按状态,如何实现啊??
在open的handler中写Ext.getCmp('init').enable();貌似不管用啊!
求教!!!
new Ext.Button({
text:'Init Card',
style:'margin-left: 20px',
id:'init'
如何让这个按钮置灰啊?还有open按钮按下以后使得open按钮本身置灰,并且让其他按钮处于可按状态
我在它的handler里面写Ext.getCmp('init').enable();貌似不管用啊?咋实现呢??