Extjs 窗体中加入form 和grid,实现不了,代码如下:

zdy32032319861105 2010-09-14 02:06:28
	var panel_north = new Ext.form.FormPanel({
// blankText : '部分一致で検索できます',
id: 'panel_north',
labelAlign: 'right',
frame: false,
height: 100,
split: true,
collapsizable: true,
// layout: 'column',
border: false,
defaultType: 'textfield',
items: [{
name: 'country_name',
fieldLabel: '国名',
// anchor: '10%'

}, {
xtype: 'button',
text: '検索',
// anchor: '10%'
//handler


}],
buttons: [{
text: 'OK'}, {
text: 'キャンセル'
}
]

});

var gird_center = new Ext.grid.GridPanel({
width: 200,
id:'gird_center',
height: 100,
border: false,
stripeRows: true,
tbar: new Ext.Toolbar({
text: '国を追加'
},'-',{
text: '編集'
},'-',{
text: '削除'
})
});



function win_country_select(){
var win = new Ext.Window({
renderTo: document.body,
constrainHeader : true,
width: 330,
layout: 'border',
title: '国の選択',
height: 300,
items: [{region: 'north',layout: 'form',width: 100,items:[panel_north]},
{region: 'center',layout: 'fit',items:[gird_center]}]
});
win.show();
};
...全文
135 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
zdy32032319861105 2010-09-15
  • 打赏
  • 举报
回复
偶像啊
hoojo 2010-09-15
  • 打赏
  • 举报
回复
var panel_north = new Ext.form.FormPanel({ 
// blankText : '部分一致で検索できます',
id: 'panel_north',
labelAlign: 'right',
frame: false,
height: 100,
split: true,
collapsizable: true,
// layout: 'column',
border: false,
defaultType: 'textfield',
items: [{
name: 'country_name',
fieldLabel: '国名',
// anchor: '10%'
}, {
xtype: 'button',
text: '検索',
// anchor: '10%'
//handler
}],
buttons: [{ text: 'OK'}, { text: 'キャンセル' } ]
});
var gird_center = new Ext.grid.GridPanel({
width: 200,
id:'gird_center',
height: 100,
border: false,
stripeRows: true,
columns: [{header: "aa"}],
store: new Ext.data.Store(),
tbar: new Ext.Toolbar({ text: '国を追加' },'-',{ text: '編集' },'-',{ text: '削除' })
});
var win = new Ext.Window({
//renderTo: document.body,
constrainHeader : true,
width: 330,
layout: 'border',
title: '国の選択',
height: 300,
items: [{
region: 'north',
//layout: 'form',//这里不能加layout
width: "100%",
items:[panel_north]
}, {
region: 'center',
layout: 'fit',
items:[gird_center]
}]
});
win.show();
magiccreeer 2010-09-14
  • 打赏
  • 举报
回复
1、打开页面有没有报错?有错的话看看是不是哪里多了或者少了标点。
2、为什么要把window写在一个函数里面啊,你的win_country_select()在onReady方法里面执行没有?把window直接写在onReady方法里面不是更好
zdy32032319861105 2010-09-14
  • 打赏
  • 举报
回复
xtype后面紧跟着如何加入一个按钮

52,798

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 Ajax
社区管理员
  • Ajax
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧