-
Unanswered: Alternative way for Ext.getCmp
Unanswered: Alternative way for Ext.getCmp
Hi,
I have lot of controls in ExtJS form which are placed inside different panels. Following is my code for one of the panel-
var pnlCIRT = new Ext.Panel({
region: 'south',
id: 'detailpanel',
collapsible: false,
autoScroll: true,
layout: 'vbox',
height: 300,
title: 'CIRT Details',
items: [{
xtype: 'fieldcontainer',
layout: 'hbox',
items: [{
xtype: 'displayfield',
id: 'dfdate',
name: 'date',
fieldLabel: 'Date',
labelWidth: 120,
value: date,
width: 143
}, {
xtype: 'splitter',
width: 200
}, {
xtype: 'displayfield',
id: 'dfcirtnumber',
name: 'cirtnumber',
fieldLabel: 'CIRT Number',
value: CIRTNumber,
labelWidth: 180,
width: 120
}]
At this point; I'm using Ext.getCmp('dfcirtnumber').setValue(results.CIRTNumber); to read the control and set value.
I think; Ext.getCmp is NOT a good practice to read and set control values if there are huge amount of controls used within a form.
Please let me know if there is any way to get and set value of control using the panel name so that I can directly get control from the panel itself.
Sencha is used by over two million developers. Join the community, wherever you’d like that community to be
or Join Us