PDA

View Full Version : Access a function declared on Ext.setup



ueilat
4 Aug 2010, 3:27 AM
I declared severl function inside Ext.Setup.
Now I have to call some of this function from a standrd html <a>
How can I do?

As example my code is:


Ext.setup({
onReady: function(){

var chiamaremoto=function() {
alert('ok');
};


}
});



now from a regular
<a href="javascript:xxxxxx()">link</a>
I want to call chiamaremoto
How can i ??

thanks in advance

evant
4 Aug 2010, 3:51 AM
You can't. That's just how JS scoping works. Of course, defining inline handlers isn't a great idea anyway.

ueilat
4 Aug 2010, 4:07 AM
So probably I approach in wrong way
Here my needs:
I want to make an app that is completly in one page and with Ajax a rad thé new content and update the contents.
So for example my container are populated with template + .update after ajax call
One of this is a list and each Li should have a link that call a new action ( defined in ext.setup)
how can I do it?
Thanks
Mauro

In ext setup I write all my code

ueilat
4 Aug 2010, 4:29 AM
I solved
I moved some common functions outside setup