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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T04:56:31+00:00 2026-06-06T04:56:31+00:00

I’m trying to override the window.confirm in ExtJS 4. The override should return either

  • 0

I’m trying to override the window.confirm in ExtJS 4. The override should return either true or false (just like confirm but with great UI).

window.confirm=function(msg) {var val=Ext.create("Ext.Window",{
    title : 'Extra window!',
    width : 150,                            
    height: 100,
    closable : true,                           
    html : msg,                         
    modal : true,
    onEsc:aa,
    items:[
           {
               xtype:'button',
               text:'Ok',
               handler:function()
               {
                   return true;
               }
           },
           {
               xtype:'button',
               text:'Cancel',
               handler:function(){
                   return false;
               }
           }
           ]
}).show();
function aa(btn)
{
    return false;
}

I’m getting the modal window wherever I use confirm, but it’s not returning either true or false, its running asynchronously.

I tried with showModalDialog instead of confirm, this time too I’m not getting return value.

Is it possible to return true or false based on user selection (when user selects ok then return true, false when clicking cancel)

  • 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-06T04:56:33+00:00Added an answer on June 6, 2026 at 4:56 am

    You cannot call modal dialog in a sync fashion. If you want to wrap it somehow into utility function that you will call from different places in your application you need to do something like this:

    showConfirmationDialog: function(question, yesCallback) {
        //... Create you window
        //... Show window - add handler to the YES button and call yesCallback from it
    },
    
    ...
    
    otherFunction: function() {
    
       this.showConfirmationDialog('Do you want to delete record?', function() {
          // Delete record
       });
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to render a haml file in a javascript response like so:
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
I've got a string that has curly quotes in it. I'd like to replace

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.