extjs combo显示问题

cheng521 2011-02-15 02:21:42

上述的combo怎么会显示这样,求指教。
...全文
859 37 打赏 收藏 转发到动态 举报
写回复
用AI写文章
37 条回复
切换为时间正序
请发表友善的回复…
发表回复
qingxugw 2011-02-16
  • 打赏
  • 举报
回复

var form_customer_detail = {
xtype: 'fieldset',
title: '测试',
name: 'form_customer_detail',
bodyStyle: 'padding-left:10px;',
items: [{
layout: 'column',
items: [{
columnWidth: .3,
layout: 'form',
labelWidth: 30,
items: [{
xtype: 'combo',
fieldLabel: '测试',
mode: 'local',
value: '测试1',
allowBlank: false,
autoWidth: true,
msgTarget: 'side',
id: 'type_custome_detail',
triggerAction: 'all',
forceSelection:true,
store: new Ext.data.ArrayStore({
fields: [
'valueText',
'displayText'
],
data: [['fixed', '全部'], ['auction', '测试'],['auctions', '测试'],['auctionh', '测试']]
}),
valueField: 'valueText',
displayField: 'displayText',
anchor: '95%'
}]
}]
}]
};


你的代码少了几个[] 括号,我在ext3.3测试后没有问题,这是我修改过的代码,你试一下
cheng521 2011-02-16
  • 打赏
  • 举报
回复
奇怪,我刚用3.3试了一下,也不我那同样的问题,那不应该是版本问题。我测试了很多次。结果都是我那样的,朋友,加下我QQ,我们详细聊聊,奇了个怪。 1094933067.
qingxugw 2011-02-16
  • 打赏
  • 举报
回复
[Quote=引用 34 楼 cheng521 的回复:]

我用的是ext3.2。
[/Quote]


我用的是3.3
我的是这样的效果
cheng521 2011-02-16
  • 打赏
  • 举报
回复
正常,百度限制了。。
cheng521 2011-02-16
  • 打赏
  • 举报
回复
我用的是ext3.2。
qingxugw 2011-02-16
  • 打赏
  • 举报
回复
我了个去,百度还不让贴它的图
qingxugw 2011-02-16
  • 打赏
  • 举报
回复
[Quote=引用 28 楼 cheng521 的回复:]

引用 27 楼 qingxugw 的回复:

JScript code

<script type="text/javascript" language="javascript">
Ext.onReady(function (){

var form_customer_detail = {
//xtype: 'fieldset',
title:……



运行结果是这……
[/Quote]
我的是这个结果

qingxugw 2011-02-16
  • 打赏
  • 举报
回复
[Quote=引用 28 楼 cheng521 的回复:]

引用 27 楼 qingxugw 的回复:

JScript code

<script type="text/javascript" language="javascript">
Ext.onReady(function (){

var form_customer_detail = {
//xtype: 'fieldset',
title:……



运行结果是这……
[/Quote]
我的是这个结果,为什么不一样呢,你用的ext哪个版本啊
cheng521 2011-02-16
  • 打赏
  • 举报
回复
[Quote=引用 26 楼 x_huangwx 的回复:]

应该是layout的影响,你换下别的布局或者干脆去掉layout试试
[/Quote]

我刚测试过,也不行,我把 layout去掉了,也换了别的布局,谢谢。。
cheng521 2011-02-16
  • 打赏
  • 举报
回复
[Quote=引用 27 楼 qingxugw 的回复:]

JScript code

<script type="text/javascript" language="javascript">
Ext.onReady(function (){

var form_customer_detail = {
//xtype: 'fieldset',
title:……
[/Quote]


运行结果是这样的,很奇怪。。
qingxugw 2011-02-16
  • 打赏
  • 举报
回复

<script type="text/javascript" language="javascript">
Ext.onReady(function (){

var form_customer_detail = {
//xtype: 'fieldset',
title: '测试',
name: 'form_customer_detail',
bodyStyle: 'padding-left:10px;',
autoHeight : true,
autoWidth : true,
items: [{
layout: 'column',
items: [{
columnWidth: .3,
layout: 'form',
labelWidth: 30,
items: [{
xtype: 'combo',
fieldLabel: '测试',
mode: 'local',
value: '测试1',
listWidth : 123,
allowBlank: false,
autoWidth: true,
msgTarget: 'side',
id: 'type_custome_detail',
triggerAction: 'all',
forceSelection:true,
store: new Ext.data.ArrayStore({
fields: [
'valueText',
'displayText'
],
data: [['fixed', '全部'], ['auction', '测试'],['auctions', '测试'],['auctionh', '测试']]
}),
valueField: 'valueText',
displayField: 'displayText',
anchor: '95%'
}]
}]
}]
};
var panel_customerdetail = new Ext.Panel({
layout:'form',
items:[form_customer_detail]
});
panel_customerdetail.render(document.body);

});
</script>


楼主你把我修改的代码完整的复制到你页面里面的<head></head> 中就行了
x_huangwx 2011-02-16
  • 打赏
  • 举报
回复
应该是layout的影响,你换下别的布局或者干脆去掉layout试试
cheng521 2011-02-16
  • 打赏
  • 举报
回复

var form_customer_detail = {
//xtype: 'fieldset',
title: '测试',
name: 'form_customer_detail',
bodyStyle: 'padding-left:10px;',
autoHeight : true,
autoWidth : true,
items: [{
layout: 'column',
items: [{
columnWidth: .3,
layout: 'form',
labelWidth: 30,
items: [{
xtype: 'combo',
fieldLabel: '测试',
mode: 'local',
value: '测试1',
listWidth : 123,
allowBlank: false,
autoWidth: true,
msgTarget: 'side',
id: 'type_custome_detail',
triggerAction: 'all',
forceSelection:true,
store: new Ext.data.ArrayStore({
fields: [
'valueText',
'displayText'
],
data: [['fixed', '全部'], ['auction', '测试'],['auctions', '测试'],['auctionh', '测试']]
}),
valueField: 'valueText',
displayField: 'displayText',
anchor: '95%'
}]
}]
}]
};
var panel_customerdetail = new Ext.Panel({
layout:'border',
items:[form_customer_detail]
});



这是我的完整代码,请大家帮忙看看,我是想实现一个基本的combo.谢谢各位。。
qingxugw 2011-02-16
  • 打赏
  • 举报
回复
[Quote=引用 15 楼 cheng521 的回复:]

引用 14 楼 wufei006007008 的回复:
JScript code
var formPanel = new Ext.form.FormPanel( {
xtype: 'fieldset',
title: '测试',
name: 'form_customer_detail',
bodyStyle: 'padding-left:10px;',
……

去掉后测试,……
[/Quote]

楼主,我知道问题在哪了 你把formpanel中的xtype: 'fieldset', 去掉就OK了
chengjing123456 2011-02-16
  • 打赏
  • 举报
回复
{
xtype : 'combo',
id : 'eventid',
hiddenName : 'symptomsdetect.eventid',
fieldLabel : '关联事件',
listWidth : 123,
width : 125,
minHeight : 200,
selectOnFocus : true,
mode : 'remote',
triggerAction : 'all',
editable : false,
store : eventStore,
displayField : 'eventname',
valueField : 'eventid',
autoLoad : true
}
你没有设置它的宽度listWidth : 123
qingxugw 2011-02-16
  • 打赏
  • 举报
回复
我还想知道lz你用的是ext的哪个版本???
能否贴出来你页面上的完整代码
qingxugw 2011-02-16
  • 打赏
  • 举报
回复
[Quote=引用 18 楼 cheng521 的回复:]

引用 17 楼 qingxugw 的回复:

JScript code

var form_customer_detail = {
xtype: 'fieldset',
title: '测试',
name: 'form_customer_detail',
bodyStyle: 'padding-left:10px;',
……


这位大侠,我试过你的代码,帮忙看一下。谢……
[/Quote]

贴出来你完整的代码,你是怎么控制显示的使用viewport 还是 render
NickCheng 2011-02-16
  • 打赏
  • 举报
回复
用jquery 自己写过个combox!~
r1988615z 2011-02-16
  • 打赏
  • 举报
回复
var form_customer_detail={
xtype: 'fieldset',
title: '测试',
name: 'form_customer_detail',
bodyStyle: 'padding-left:10px;',

开头这段加 宽度与高度!!! 用
autoHeight : true,
autoWidth : true,
试试 !!!!
cheng521 2011-02-16
  • 打赏
  • 举报
回复
[Quote=引用 17 楼 qingxugw 的回复:]

JScript code

var form_customer_detail = {
xtype: 'fieldset',
title: '测试',
name: 'form_customer_detail',
bodyStyle: 'padding-left:10px;',
……
[/Quote]

这位大侠,我试过你的代码,帮忙看一下。谢谢.
加载更多回复(15)

81,090

社区成员

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

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