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

  • Home
  • SEARCH
  • 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 8916447
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T05:14:41+00:00 2026-06-15T05:14:41+00:00

Ext.Ajax.request({ url: ‘foo.php’, // where you wanna post success: passFn, // function called on

  • 0
Ext.Ajax.request({
   url: 'foo.php',    // where you wanna post
   success: passFn,   // function called on success
   failure: failFn,
   params: { foo: 'bar' }  // your json data
});

I am following How to post json data with extJS and got a question regarding functions. I see that we can embed functions right in the passFn and failFn area. However, what if I want these functions to be elsewhere? Where to create these functions and code them in Sencha Architect?

  • 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-15T05:14:42+00:00Added an answer on June 15, 2026 at 5:14 am

    You can create a folder that is outside of Sencha Architect control, and call it from inside your Architect code.

    For example, I like to create a folder called “util”. So here is what your folder structure will look like:

    app
      -- controller
      -- model
      -- store
      -- view
      -- util    <--- I added this directory
          -- MiscFunctions.js  <-- your own class file
    

    Inside MiscFunctions.js, you would create the class like so:

    Ext.define('MyApp.util.MiscFunctions', {
       singleton: true,
       passFn: function() {
          ...
       },
       failFn: function() {
       }
    });
    

    Then you can refer to those functions from inside your Architect code:

    Ext.Ajax.request({
       url: 'foo.php',    // where you wanna post
       success: MyApp.util.MiscFunctions.passFn,   // function called on success
       failure: MyApp.util.MiscFunctions.failFn,
       params: { foo: 'bar' }  // your json data
    });
    

    Don’t forget to add the

    singleton: true
    

    part, or else you will have to create an instance of that class to use the functions inside.

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

Sidebar

Related Questions

function workprogress(){Ext.Ajax.request({ url: 'communication.php', success: noWork, failure: yesWork });} function noWork() { infoWindow.hide(); }
Ext.Ajax.request({ url: 'http://bar.com/api/foos/', success: function(response, opts) { // How parse the response containing the
Ext.Ajax.request({ url:'abc/abc/abc', success: function(response){ var result = Ext.decode(response.responseText); var value=result.roles; } }); How can
Ext.Ajax.request({url:'DeleteAction',success: doneFunction,failure: errorFunction,params:{name:rname}}); The above code is my Ajax request which goes to DeleteAction
I have the following code Ext.Ajax.request({ url: 'newRecord.php', method: 'POST', type: 'json', params: {
this.getSecondPanel = function(argPanel, argID) { Ext.Ajax.request({ url : 'myActionURL', params : {id: argID}, success
I have this EXT JS code: Ext.Ajax.request({ url : xxx, method : POST, params
I have an ajax request sending some data to a php file: Ext.Ajax.request({ url:
I have a problem with using Ajax. function GetGrantAmazonItemCnt(){ var cnt; Ext.Ajax.request({ url :
Im getting a bad request when running this code Ext.Ajax.request({ url: loginHostUri, method:'POST', headers:{

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.