If someone can help me figure out how to get this ...
# suitescript
d
If someone can help me figure out how to get this working, I'd appreciate it very much: I have a button that runs a client script that performs a search. However, when someone clicks the button, it just sits there with the button looking like it's been pressed. Is there a way to have a popup stating "search is running" then it executes the search? I've tried several different options, but the popup always comes up after the function has finished running.
Copy code
function calcDiscount(){
    showPopup();
    console.log('the search is running');
    //  SEARCH RUNS HERE AND TAKES ABOUT 30 SECONDS, BUT POPUP SHOWS ONLY AFTER THE SEARCH IS DONE RUNNING
}

function showPopup(){
    Ext.Msg.show({
        title: 'hello',
        msg: 'testing',
        width: 300,
        wait: false
    });
}
b
n
use alert("Search is running") instead of the "showPopup()" line.
d
@battk. I have some other operations happening after the search as well. 😕 @NickSuite alert() halts execution of the rest of the script, until I click OK. I was able to get Ext.msg.show() to do similar, but it doesn't execute the function until after OK is clicked.
b
d
Thanks. I will take a look at this. I appreciate it!