Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8633919
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:35:25+00:00 2026-06-12T09:35:25+00:00

I am trying to dynamically build a extjs form and when I try to

  • 0

I am trying to dynamically build a extjs form and when I try to add the dynamically built MixedCollection object to the form I get a TypeError: e.mixins.elementCt is undefined error.

<div id="form-@pageSpecificVar" class="grid-container even"></div>
<script>

    Ext.define('HeaderForm', {
        extend: 'Ext.form.Panel',
        initComponent: function () {
            var me = this;
            Ext.applyIf(me, {
                id: Ext.id(),
                defaultType: 'textfield',
                items: [{
                    xtype: 'container',
                    items: [{
                        xtype: 'textfield',
                        fieldLabel: 'Test'
                    }]
                }]
            });
            me.callParent(arguments);
        }
    });

    // Define our data model
    Ext.define('HeaderModel', {
        extend: 'Ext.data.Model',
        fields: [
            { name: 'FieldA', type: 'int' }
        ]
    });

    var store = Ext.create('Ext.data.Store', {
        model: 'HeaderModel',
        proxy: {
            type: 'ajax',
            actionMethods: { create: 'POST', read: 'GET', update: 'POST', destroy: 'POST' },
            url: '@Url.Content("~/Test/Header")',
            timeout: 1200000,
        listeners: {
            load: function () {
            }
        }
        }
    });

    store.load({
        scope: this,
        callback: function (records, operation, success) {
                var form = new HeaderForm();
                var formItems = new Ext.util.MixedCollection();
                Ext.each(records[0].fields.items, function (item) {
                    console.log(item);
                    formItems.add(new Ext.form.DisplayField({
                        fieldLabel: 'Test'
                    }));
                }, this);
                console.log(formItems);
                form.add(formItems);
                form.loadRecord(records[0].data);
                form.render('form-@pageSpecificVar');
        }
    });
</script>

Another thing I don’t understand is, when I put the function inside the load listener, nothing happens. So I had to resort to using the callback event.

Update:
form.add method takes a component or component array, so instead of adding MixedCollection type I refer to formItems.items to add the array of displayfields components.

But for some reason the store listeners load is not getting triggered when store.load is executed, does anyone see a problem with that?
Nevermind this… I figured out… I placed the listener instead of the proxy instead of the store.

Q2

Also something weird is that during the callback method of store.load, the records is not return with the loaded values.
Nevermind this… I figured out… It was the json object I’m passing. Forgot to take it out of the error/data structure for form.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T09:35:27+00:00Added an answer on June 12, 2026 at 9:35 am

    MixedCollection isn’t an accepted parameter for add, you need to use an array. This info is in the docs.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to dynamically build a form based on data returned from the
I'm trying to build a form dynamically based on the field and its definitions
I'm trying to dynamically build up expressions based on a Specification object. I've created
I have a javascript question. I'm trying to dynamically build a plugins string variable
I'm trying to build an associative array in PHP dynamically, and not quite getting
So i am trying to build and prepare using PDO, a mysql query dynamically.
I am trying dynamically add children DIV under a DIV with ID=prnt. Addition of
I am trying to dynamically request a file for download via a GET ajax
I'm trying to dynamically bind mysql_stmt parameters and get the result in an associative
I'm trying to use the type(,,) function to dynamically build a module. The module

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.