关于在extjs中使用column布局,不能显示textfield的标签(fieldLabel)解决方法
2016-05-27 16:03
976 查看
摘自:http://blog.csdn.net/suixufeng/article/details/6587989
原因:fieldLabel is not rendered by the field itself, but by FormLayout. So for you to have a label you need to put the field in a form layout, e.g.
在coluumn的子项中加上layout:'form'就ok了
错误示例:
[php] view
plain copy
var d = new Ext.Window({
title: instance,
layout: 'border',
width:375,
height:275,
cls: 'x-dialog-popup-main',
items: [{
region: 'center',
title: 'General Information',
layout: 'table',
layoutConfig: { columns: 2 },
items: [
new Ext.form.TextField({
colspan: 2,
fieldLabel: 'My Label',
disabled: true,
hideLabel: false
})
]
}, {
region: 'south',
title: 'Controls',
height: 100
}]
});
需改动的:
[php] view
plain copy
layout: 'table',
layoutConfig: {columns: 2},
items: [{
layout: 'form',
colspan: 2,
items: [{
xtype: 'textfield'
fieldLabel: 'My Label',
disabled: true,
}]
}]
原因:fieldLabel is not rendered by the field itself, but by FormLayout. So for you to have a label you need to put the field in a form layout, e.g.
在coluumn的子项中加上layout:'form'就ok了
错误示例:
[php] view
plain copy
var d = new Ext.Window({
title: instance,
layout: 'border',
width:375,
height:275,
cls: 'x-dialog-popup-main',
items: [{
region: 'center',
title: 'General Information',
layout: 'table',
layoutConfig: { columns: 2 },
items: [
new Ext.form.TextField({
colspan: 2,
fieldLabel: 'My Label',
disabled: true,
hideLabel: false
})
]
}, {
region: 'south',
title: 'Controls',
height: 100
}]
});
需改动的:
[php] view
plain copy
layout: 'table',
layoutConfig: {columns: 2},
items: [{
layout: 'form',
colspan: 2,
items: [{
xtype: 'textfield'
fieldLabel: 'My Label',
disabled: true,
}]
}]
相关文章推荐
- Extjs 中column的renderer使用方法
- 对jsp 的认识
- JavaScript笔记(2)数据准备-常量与变量
- Ext JS 6开发实例(四) :调整主视图
- Ext JS 6开发实例(四) :调整主视图
- Ext JS 6开发实例(四) :调整主视图
- Ext JS 6开发实例(四) :调整主视图
- ExtJS新手学习中常见问题
- ExtJS新手学习中常见问题
- JavaScript删除数组重复元素的5个高效算法
- js 进行数字运算
- 通过媒体查询meta和JS转换REM单位实现100%自适应
- JS--- (function(){...})() 是什么
- js 日期形式
- JavaScript中getBoundingClientRect()方法详解
- JSON.stringify 语法实例讲解
- 使用Extjs4创建一个头行结构的界面
- 在JSP中的注释
- 深入理解JavaScript事件捕获,阻止
- Javascript This 关键字