PDA

View Full Version : New to Ext-js calling inside Ext.onReady(test());



mahdesh
9 May 2010, 12:35 AM
Folks,

I am newbie to ext js and have startup issues. As you see below, I am just calling test() in onReady().
This should execute whatever is inside test(), but it gives only first alert and then stops, how to proceed?

Thanks in advance :), help asap to get rid of of this startup issue.

This is my hello.html

<

html>

<


head>

<


title>Getting Started Example</title>

<scripttype="text/javascript"src="../adapter/ext/ext-base.js"></script>
<scripttype="text/javascript"src="../ext-all-debug.js"></script>
<scripttype="text/javascript"src="../mahesh.js"></script>
<!-- script type="text/javascript" src="ExtStart.js"></script-->
<linkrel="stylesheet"type="text/css"href="../resources/css/ext-all.css">


<


script>

Ext.onReady(test());



function


test(){

alert('test changed1......');
Ext.Msg.prompt('Name', 'Please enter your name:', function(btn, text){
if (btn == 'ok'){
// process text value and close...
}
});
alert('test2...');
};


</


script>

</


head>

<


body>

<!-- Nothing in the body -->
</


body>
</html>

Animal
9 May 2010, 1:07 AM
So reading that unreadable code...

What is the value that gets passed into the onReady function?

Read it carefully, and determine what is received by onReady.

eugs51
9 May 2010, 9:19 PM
Ext.onReady(test());


You are executing test not passing it, Try using



function test(){
....
}
Ext.onReady(test);

Animal
9 May 2010, 11:12 PM
He'll have to learn code comprehension one day. He'll be back until he learns while someone is willing to hand the answer on a platter.