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 7518353
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T01:44:17+00:00 2026-05-30T01:44:17+00:00

I am new to ExtJS 4 and am trying to implement a simple application

  • 0

I am new to ExtJS 4 and am trying to implement a simple application in MVC style. The documentation is really good and this is one of the topics covered in the Form package guide, but it doesn’t seem to work in my case.

The app basically can create, edit and delete articles.The creation and editing are in pop-up windows.
The pop-up window contains a form with a text field and html-editor.
Please click on the link below,this is the error in Google Chrome Console when I click on the submit button in the ‘window’

http://www.freeimagehosting.net/mjig7

Here is the code which I’ve written
Model:

Ext.define('AM.model.Article', {
    extend: 'Ext.data.Model',
    fields: ['name', 'data'],
    proxy: {
        type: 'rest',
        url: 'users/data',
        reader: {
            type: 'json',
            root: 'myJaxBean',
            successProperty: 'success'
        },
        writer: {
            type: 'json'
        }
    }
});

View:

Ext.define('AM.view.New', {
    extend: 'Ext.window.Window',
    alias : 'widget.new',
    title : 'New Article',
    autoShow: true,
    fieldDefaults: {
        labelAlign: 'top',
        msgTarget: 'side'
    },
    layout: 'fit',
    bodyStyle:'padding:5px 5px 0',
    width: '70%',
    height: '40%',
    initComponent: function() {
        this.items = [
            {
                xtype: 'form',
                anchor: '99%',
                items: [
                    {
                        xtype: 'textfield',
                        name : 'name',
                        fieldLabel: 'Article Name',
                        anchor: '99%'
                    },
                    {
                        xtype: 'htmleditor',
                        name : 'data',
                        fieldLabel: 'Article',
                        anchor: '99% -25'
                    }
                ],
                buttons: [
                {
                    text: 'Submit',
                    handler: function() {
                        var form = this.up('form').getForm(), // get the basic form
                            record = form.getRecord(); // get the underlying model instance
                        if (form.isValid()) { // make sure the form contains valid data before submitting
                            form.updateRecord(record); // update the record with the form data
                            record.save({ // save the record to the server
                                success: function(user) {
                                    Ext.Msg.alert('Success', 'User saved successfully.')
                                },
                                failure: function(user) {
                                    Ext.Msg.alert('Failure', 'Failed to save user.')
                                }
                            });
                        } else { // display error alert if the data is invalid
                            Ext.Msg.alert('Invalid Data', 'Please correct form errors.')
                        }
                    }
                },
                {
                    text: 'Cancel',
                    scope: this,
                    handler: this.close
                }
            ]
            }
        ],


        this.callParent(arguments);
    }
});

and finally the code in my controller which makes the window visible

Controller:

.....

'viewport > panel > panel > tbar button[action=newarticle]' :{
                click: this.newArticle
            },
....

   newArticle: function(button){
        var view = Ext.widget('new');
    },

Please point me in the right direction in case I am doing something wrong.
Thanks in advance.

  • 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-05-30T01:44:18+00:00Added an answer on May 30, 2026 at 1:44 am

    Check the docs getRecord():

    Returns the last Ext.data.Model instance that was loaded via
    loadRecord

    so it’s clear that you haven’t load any record, so you getRecord() returns undefined. And you are getting your error further.

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

Sidebar

Related Questions

I am new to ExtJs(using EXT js 4 ), I am trying out simple
I'm trying to learn the new MVC architecture that ExtJS 4 is using and
I am new to extJS, and trying to implement the following functionality: I have
I'm new to ExtJS and trying to experiment with the border layout. I can't
I'm using extjs and just trying to solve a simple problem: I have a
Hi I am trying to develop a simple form in extjs, but the problem
I'm trying to implement a TinyMCE plugin with ExtJs, with a demo as example,
I was trying to render a simple piechart using ExtJs 3.0 but could not.
I'm trying to get a simple GXT application to retrieve data from an external
I am creating a new ExtJS widget using Ext.view.View. The template for this view

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.