Search code examples
javascriptextjsextjs4rally

After displaying the message, want return to first screen


Actually I am showing a chooserDialog and allowing user to select one of the option. And after completing the function displaying the Msg box with "Completed MSg", and after clicking on "OK" want to shows ChooserDialog again

Below is the code for showing msg

createFeature: function() {
    var record = Ext.create(this.model, {
        Name: "(Copy of) " + this._newObj.get('Name'),
    });
    record.save({
        callback: function(result, operation) {
            if(operation.wasSuccessful()) {
                Ext.Msg.alert('created ' + result.get('PortfolioItemTypeName') + ':', result.get('Name'));
            }
            else{
                console.log("error");
            }
        }
    });
}   

Solution

  • The docs are your friend: http://docs.sencha.com/extjs/4.2.3/#!/api/Ext.MessageBox-method-alert

    You'll notice that the 3rd argument of the alert() method is an optional callback message that can be executed when the MessageBox is closed. That will be where you want to implement any post-"OK"-click logic.