PDA

View Full Version : Add items to View from another view



mharris45
18 Apr 2012, 11:03 AM
Hello, I'm rather new to ExtJS, but I'm moving along quite nicely. However, I've run into a problem.

I have a view called TaskForm, which contains several items. One of which is a ComboBox that his some complex logic to it and is used in several different locations (once complete). I'm trying it do something like this, from within the view:


items: [
{Ext.widget('empcomposite', {
valFieldNamekey: 'RQT_EMP_CD',
displFieldName: 'RQT_NAME',
fieldLabel: 'Requestor'})
},{
// This is just for testing purposes
xtype: 'textfield',
name: 'text1',
},
{
// This is just for testing purposes
xtype: 'textfield',
name: 'text1',
},

But, it does not work at all. I'm pretty sure it's easy to do, but I'm just missing something basic here. Any help would be appreciated.

scottmartin
18 Apr 2012, 8:08 PM
You could create your item:

mywidget = Ext.create('mywidget', { .. });

items: [ mywidget ]

Regards,
Scott.

mharris45
19 Apr 2012, 7:48 AM
Hmm, that doesn't seem to work.

It appears that makes it try and call the javascript file directly.


var comp = this;
comp.empwidget = Ext.create('empcomposite', {
valFieldNamekey: 'RQT_EMP_CD',
displFieldName: 'RQT_NAME',
fieldLabel: 'Requestor'
});


Results in a 400 Bad Request.

mharris45
19 Apr 2012, 10:36 AM
Everything seems to be working now. You're suggestion worked great, along with correctly defining my views in the controller.

Thanks.