1
私はすでに作成したレイアウトにツールバーを追加しようとしています。私は、ツールバーとレイアウトの両方のためのコードを持っているが、私は、私が持っている私のツールバーextjsのレイアウトにツールバーを追加するにはどうすればよいですか?
<script>
Ext.onReady(function() {
new Ext.Toolbar({renderTo: Ext.getBody(),
items: [{
xtype: 'button',
text: 'Menu Button',
menu: [{
text: 'Better'
}, {
text: 'Good'
}, {
text: 'Best'
}]
},'->', {
xtype: 'splitbutton',
text: 'Split Button',
menu: [{
text: 'Item One'
}, {
text: 'Item Two'
}, {
text: 'Item Three'
}]
},'', {
xtype: 'cycle',
showText: true,
minWidth: 100,
prependText: 'Quality: ',
items: [{
text: 'High',
checked: true
}, {
text: 'Medium'
}, {
text: 'Low'
}]
},]
});
});
</script>
のために、私のレイアウトのためにあまりにも
を統合する方法を知らない
<script>
var viewport = new Ext.Viewport({
layout: "border",
defaults: {
bodyStyle: 'padding:10px;',
},
items: [{
region: "north",
html: 'North',
margins: '5 5 5 5'
}, {
region: 'west',
collapsible: true,
title: 'Some Info',
width: 200,
html: 'West',
margins: '0 0 0 5'
}, {
region: 'center',
title: 'Our Info',
html: 'Center',
margins: '0 0 0 0'
}, {
region: 'east',
collapsible: true,
width: 200,
title: 'Their Info',
html: 'East',
margins: '0 5 0 0'
}, {
region: 'south',
title: 'Their Info',
html: 'South',
width: 200,
margins: '5 5 5 5'
}]
});
</script>
どのようにすることができます私はこのページのツールバーを使用していますか? おかげ
@Justin、ここに私の完全なコード
var viewport = new Ext.Viewport({
layout: "border",
tbar: new Ext.Toolbar({
//Toolbar config options
items: [{
xtype: 'button',
height: 27,
text: 'Menu Button',
menu: [{
text: 'Better'
}, {
text: 'Good'
}, {
text: 'Best'
}]
}, '->',
{
xtype: 'splitbutton',
text: 'Split Button',
menu: [{
text: 'Item One'
}, {
text: 'Item Two'
}, {
text: 'Item Three'
}]
}, '',
{
xtype: 'cycle',
showText: true,
minWidth: 100,
prependText: 'Quality: ',
items: [{
text: 'High',
checked: true
}, {
text: 'Medium'
}, {
text: 'Low'
}]
}, ]
}),
defaults: {
bodyStyle: 'padding:10px;',
},
//layouf config
tems: [{
region: "north",
html: 'North',
margins: '5 5 5 5'
}, {
region: 'west',
collapsible: true,
title: 'Some Info',
width: 200,
html: 'West',
margins: '0 0 0 5'
}, {
region: 'center',
title: 'Our Info',
html: 'Center',
margins: '0 0 0 0'
}, {
region: 'east',
collapsible: true,
width: 200,
title: 'Their Info',
html: 'East',
margins: '0 5 0 0'
}, {
region: 'south',
title: 'Their Info',
html: 'South',
width: 200,
margins: '5 5 5 5'
}]
});
ちょっとジャスティン、お返事ありがとうございます。私はまだちょっと残っている!私はextjsの初心者なので、どうしたらいいか分からない。あなたの回答を使って自分のコードを編集しますが、まだ進歩していません。私の完全なコードを見て、何かが欠けている場合は私をtekllしてください。ありがとう – Tony
トニー - 私は見ることができるようにあなたの全体のコードをコピーします。最初に私が見るのは、あなたがrenderTo設定オプションを削除したときに、あなたは "{"のオープニングも削除したことです。 configオプションのオブジェクトを受け付ける新しいツールバーを作成しているので、新しいExt.Toolbar({//あなたの設定オプション})が必要です。 – Justin
、ありがとうございます。今、このコードは私のレイアウトを示していますが、まだ私のツールバーを表示することができません。 – Tony