A. extjs中 如何兩列布局表單 在線等
你這種情況不應該使用column來布局,column是一種自適應的布局,應該使用table或者hbox布局,拿做例子,會更適合你這情況:
varform=Ext.create('Ext.form.Panel',{
layout:{
type:'table',
columns:2,//每行有幾列
//默認樣式
tableAttrs:{
style:"width:100;height:40;"
}
},
initComponent:function(){
varme=this;
Ext.applyIf(me,{
items:[
{
xtype:'numberfield',
name:'1',
colspan:1//表示佔用幾列
},
{
xtype:'numberfield',
name:'2',
colspan:1
}
//.........
]
});
me.callParent(arguments);
}
})
B. EXTJS中怎樣以百分比方式設置window的寬度和高度
寬是可以百分比設置的, 但是高度是不能按百分比設置, 設置了也沒效果。這是我自己的答案
C. 請問在extJs中怎麼讓window放到panel裡面去啊,或是用什麼 方法能讓一個組件能容納window這個組件,
window沒法放panel里~window是show出來的一個特殊的panel~
你想讓window不能移出上下的toolbar,只能是你中間那塊是個iframe,且該window是iframe內的~可顯然這樣會很麻煩~
還有一個可以嘗試一下,就是監聽move~在組件移動之後觸發~然後你去自己計算它的xy,去處理你要的需求~就像cqh46給的第二個連接那樣,window移出了界,一松滑鼠就回到某個位置~
D. EXTJS:如何讓window窗口在布局外顯示
function helpWin(content,x,y){
var win = new Ext.Window({
width:250,
height:400,
title:'幫助與支持',
border :false,
bodyStyle:"background-color:white;padding:5px 5px 5px;border: 0px",
x:x,
y:y,
draggable:false,
closeAction :'hide',
collapsible :true,
constrain :true,
maximizable :true,
items:[{html:content, border :false}]
});
return win;
}
僅供參考
E. 如何用Extjs進行下面的布局,整體是個panel 內部3個子panel 並且還可以拆分成2部分(如圖)
簡單來說,就是hbox或column橫向布局,再用vbox縱向布局
代碼如下:
Ext.onReady(function(){
Ext.create('Ext.panel.Panel',{
layout:{
type:'column'
},
default:{
xtype:'panel'
},
border:1,
width:600,
height:400,
padding:10,
items:[{
margin:'30px',
width:150,
height:290,
layout:'vbox',
items:[{
width:150,
height:90,
html:'form'
},{
width:150,
height:200,
html:'grid<br>Panel'
}]
},{
margin:'30px30px30px0',
width:150,
height:290,
layout:'vbox',
items:[{
width:150,
height:90,
html:'form'
},{
width:150,
height:200,
html:'grid<br>Panel'
}]
},{
margin:'30px30px30px0',
width:150,
height:290,
layout:'vbox',
items:[{
width:150,
height:90,
html:'form'
},{
width:150,
height:200,
html:'grid<br>Panel'
}]
}],
renderTo:Ext.getBody()
})
效果如下圖:
F. 在ExtJs中,TabPanel中如何布局,讓兩個文本框在一行顯示呢
兩個組件顯示到一行就用布局,從你需要的效果來看,有兩種方法:
1、要用到兩個布內局的結合,分別是容column和form布局;
2、用一種布局加panel代替顯示原來組件的fieldlabel;
我個人比較偏向第一種,代碼如:
...
layout:'column',
items:[
{
columnWidth:.5,
layout:'form',
items:[sexTextFiled] //sex 的組件
},{
columnWidth:.5,
layout:'form',
items:[dateField] //date 的組件
}
]
順便說下為什麼要兩種布局組合,因為column布局的效果不能顯示fieldLabel,只有form布局可以顯示fieldLabel。當然,你要的效果也有其他方法可以實現,希望對LZ有幫助。