Extjs 如何添加字段';什么是飞行中的配置?
我想在我单击树面板中的节点时添加allow Blanks的配置! 若节点是一个叶子,我想把name字段的config:allowBlank:false 如果不是一片叶子,那是真的。 我没办法这么做 非常感谢:)Extjs 如何添加字段';什么是飞行中的配置?,extjs,extjs4,Extjs,Extjs4,我想在我单击树面板中的节点时添加allow Blanks的配置! 若节点是一个叶子,我想把name字段的config:allowBlank:false 如果不是一片叶子,那是真的。 我没办法这么做 非常感谢:) 感谢您的回答,但我的组合框不是全局变量: var monPrepanel = Ext.create('Ext.form.Panel',{ frame : true, title : 'Editing Zone', //renderTo
感谢您的回答,但我的组合框不是全局变量:
var monPrepanel = Ext.create('Ext.form.Panel',{
frame : true,
title : 'Editing Zone',
//renderTo : 'mesfields',
//width : 750,
forceFit : true,
items: [{
xtype:'fieldset',
title: 'Add Task : ',
margin : '20 20 20 20',
collapsible: true,
defaultType: 'textfield',
defaults: {anchor: '100%'},
layout: 'anchor',
items: [ {
itemId : 'p0',
allowBlank : false,
xtype : 'textfield',
anchor : '60%',
padding : '0 30 0 30',
fieldLabel : 'Task',
name : 'task'
} , {
itemId : 'p1',
allowBlank : false,
xtype : 'combobox',
anchor : '40%',
store : materialstore,
queryMode: 'local',
displayField: 'data',
width : 50,
valueField: 'data',
editable : false,
padding : '0 30 0 30',
fieldLabel : 'Material',
name : 'material'
} , {
allowBlank : true,
xtype : 'combobox',
anchor : '40%',
store : ccstore,
queryMode: 'local',
displayField: 'data',
width : 50,
valueField: 'data',
editable : false,
padding : '0 30 0 30',
fieldLabel : 'CC',
name : 'cc'
}
我需要通过id访问combobox组件,也许?
有一些解决方案可以将此组件访问到项目到项目?一般来说,这就是如何将更改“应用”到已创建的Ext组件
var combo = new Ext.form.ComboBox({some initial config});
Ext.apply(combo, {your config object});
你怎么装你的Treenodes?如果是从后端添加这些属性,您可能会做得更好。为所需的组合框(
id:'anyId'
)设置一个id
属性,并使用Ext.apply(Ext.getCmp('anyId'),{your config object})代码>感谢您的回答,但我的组合框不是一个全局变量,不一定是。如果知道DOM id是什么,可以使用Ext.getCmp('myDomID')获取对它的引用;这种“应用”技术是否也适用于那些改变组件布局的配置。例如,Ext.form.FieldSet可折叠属性在渲染后设置为true。在我的例子中,布局没有更新:Ext.apply(字段集,{collapsable:true,style:“background:red”});这将更新对象的配置。但是,您可能需要对组件所在的容器调用doLayout()。如何获取现有配置,请用现有配置替换{your config object}