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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:04:09+00:00 2026-05-23T08:04:09+00:00

What I am trying to do is is get the information I have in

  • 0

What I am trying to do is is get the information I have in my ajax request as the badgetext number

Here is where I am trying to do it. This seems simple, but I cant figure it out.

    Ext.Ajax.request({
      url: '../lib/messages.php',
      success: function(response, opts) {
      var badge_number = Ext.decode(response.responseText);
      console.dir(badge_number);
},
    failure: function(response, opts) {
    console.log('server-side failure with status code');
}
});

     var buttonsGroup1 = [{
      text: 'Messages',
      //badge_number variable from ajax request would go here. badgeText: '2',
      handler: tapHandler
    }]; 
  • 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-23T08:04:09+00:00Added an answer on May 23, 2026 at 8:04 am

    Ah ok, I misread the question.

    So the most straight forward way to put the badge text on the button is to create a closure.

    var button = new Ext.Button({
      text: 'Messages',
      handler: tapHandler});
    
    Ext.Ajax.request({
      ....
      success: function(response, opts){
         button.setBadge(Ext.decode(response.responseText));
      }
      ...
    });
    

    This will cause the badge text to be updated when the AJAX call completes. You can then add the object to a Panel or Toolbar after the AJAX request code as you would have before.

    If you absolutely have to have the badge text on the button before it is created, you will need to create the button group inside the success function and assign/add it to the appropriate container object.

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

Sidebar

Related Questions

Firstly apologies if this is really simple but I have spent hours trying and
http://jqueryui.com/demos/accordion/#event-changestart I'm trying to have an JQuery ajax request get some data and populate
i have two tables i am trying to get information from. login table -
I'm trying to get information from a cookie into Alfresco Share. I have a
I have a Javascript Highchart that I'm displaying and trying to get more information
i have to get static information from one 'module' to another. I'm trying to
I'm trying to get information from this site: http://www.gocrimson.com/sports/mbkb/2011-12/roster If you look at that
I'm trying to get a tracking script working that uses AJAX via JQuery. This
I'm stuck trying to solve this. I'm plotting some information that I have in
This is the response page that i get frmo my ajax request. Internal Server

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.