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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T16:05:06+00:00 2026-06-05T16:05:06+00:00

I use it quite often in an app I am making, so I would

  • 0

I use it quite often in an app I am making, so I would like to shorten it up if I can and make an extended class to handle all the callback logic in one place, I tried setting it up like this but fails when trying to load the class with:

Uncaught TypeError: Cannot read property 'isInstance' of undefined ext-all-debug.js:4136
ExtClass.registerPreprocessor.config ext-all-debug.js:4136
Ext.apply.doProcess ext-all-debug.js:4007
Manager.registerPostprocessor.uses ext-all-debug.js:6037
Ext.apply.require ext-all-debug.js:5771
Manager.registerPostprocessor.uses ext-all-debug.js:6004
Ext.apply.doProcess ext-all-debug.js:4007
Ext.apply.doProcess ext-all-debug.js:4008
Ext.apply.process ext-all-debug.js:3995
Ext.Class.ExtClass ext-all-debug.js:3911
Ext.ClassManager.create ext-all-debug.js:4676
Ext.apply.define ext-all-debug.js:5095
(anonymous function) Ajax.js:1 //My extended Ajax singleton

Here is how I try to call it

    var changes = e.record.getChanges();
    if (e.record.get('id'))
        changes.id = e.record.get('id');

    APP.ux.Ajax.request({
        url: '/admin/user/save/',
        params: changes,
        scope: this
    });

UPDATE
That makes sense, I can’t believe overlooked that, but I still get the same read property ‘isInstance’ of undefined error above. Here is how it looks now

And here is the simple class (Updated)

Ext.define('APP.ux.Ajax', {
extend: 'Ext.data.Connection',
requires: [
    'APP.ux.Msg'
],
singleton : true,
autoAbort : false,
request: function(config) {
    var cfg = config;

    Ext.apply(cfg, {
        success: function(form, action) {
            APP.ux.Msg.alert('Success', action.result.msg);
            //TODO: Add more logic here
        },
        failure: function(form, action) {
            switch (action.failureType) {
                case Ext.form.action.Action.CLIENT_INVALID:
                    APP.ux.Msg.alert('Failure', 'Form fields may not be submitted with invalid values');
                    break;
                case Ext.form.action.Action.CONNECT_FAILURE:
                    APP.ux.Msg.alert('Failure', 'Ajax communication failed');
                    break;
                case Ext.form.action.Action.SERVER_INVALID:
                    APP.ux.Msg.alert('Failure', action.result.msg);
                    break;
            }
        }
    });
    this.callParent(cfg);
}
});
  • 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-05T16:05:08+00:00Added an answer on June 5, 2026 at 4:05 pm

    That’s not gonna work like this. If you want to have failure/success handlers in one place – you need to overwrite standard request() method, something like this (this would go to your App.ux.Ajax class)

    request: function(config) {
      var cfg = config;
    
      Ext.apply(cfg, {
        success: function(form, action) {
           APP.ux.Msg.alert('Success', action.result.msg);
           //TODO: Add more logic here
        },
        failure: function(form, action) {
           switch (action.failureType) {
            case Ext.form.action.Action.CLIENT_INVALID:
                APP.ux.Msg.alert('Failure', 'Form fields may not be submitted with invalid values');
                break;
            case Ext.form.action.Action.CONNECT_FAILURE:
                APP.ux.Msg.alert('Failure', 'Ajax communication failed');
                break;
            case Ext.form.action.Action.SERVER_INVALID:
                APP.ux.Msg.alert('Failure', action.result.msg);
                break;
           }
        }
      });
    
      this.callParent(cfg);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We make use of views and panels quite often in Drupal and a lot
I quite often use Drupal's Views Module to build SQL that I paste into
Using Java IO streams, it is quite often we use objects solely as constructors
Dear experts, I am quite new to javascript and I often see coders use
I have a class (let's name it TheClass ) that is quite often used
I use the switch feature of Subversion quite often, but sometimes I forget where
I use Solr's proximity search quite often to search for words within a specified
I quite often see the following naming convention used in java code. class SomeClass
I use vi quite often to edit files. Usually I need the file to
I use a binary library that crashes quite often. When it does, some times

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.