1. #1
    Ext JS Premium Member
    Join Date
    Apr 2012
    Location
    Madison, WI
    Posts
    38
    Answers
    1
    Vote Rating
    1
    mharris45 is on a distinguished road

      0  

    Default Answered: Add items to View from another view

    Answered: Add items to View from another view


    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:
    Code:
    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.

  2. You could create your item:

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

    items: [ mywidget ]

    Regards,
    Scott.

  3. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,011
    Answers
    668
    Vote Rating
    460
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    You could create your item:

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

    items: [ mywidget ]

    Regards,
    Scott.

  4. #3
    Ext JS Premium Member
    Join Date
    Apr 2012
    Location
    Madison, WI
    Posts
    38
    Answers
    1
    Vote Rating
    1
    mharris45 is on a distinguished road

      0  

    Default


    Hmm, that doesn't seem to work.

    It appears that makes it try and call the javascript file directly.
    Code:
    var comp = this;
        	comp.empwidget = Ext.create('empcomposite', {
        		valFieldNamekey: 'RQT_EMP_CD',
       		displFieldName:  'RQT_NAME',
       		fieldLabel: 	 'Requestor'
        	});
    Results in a 400 Bad Request.

  5. #4
    Ext JS Premium Member
    Join Date
    Apr 2012
    Location
    Madison, WI
    Posts
    38
    Answers
    1
    Vote Rating
    1
    mharris45 is on a distinguished road

      0  

    Default


    Everything seems to be working now. You're suggestion worked great, along with correctly defining my views in the controller.

    Thanks.

Thread Participants: 1