Ext


Go Back   Ext JS Forums > Ext GWT Community Forums (2.x) > Gxt: Help

Reply
 
Thread Tools
  #1  
Old 11-07-2009, 02:51 AM
rehanqu rehanqu is offline
Ext JS Premium Member
 
Join Date: Jul 2009
Posts: 10
rehanqu is on a distinguished road
Default How to call a function with in Ext

Hi guys..
I have quick question. I want to be able to access a funtion inside Ext from outside. Please see the example bleow:

 
//ext starts here 
Ext.onReady(function(){
  var spot = new Ext.ux.Spotlight({
   easing: 'easeOut',
   duration: .3
  });
 
  function display() {  
   spot.show("answerParticipant_faq10");
  }
 });
//ext ends here
 
 
 function fnDisplayAnswer(ansId) {
  var ObjContent11 = document.getElementById("answerParticipant_faq10");
  ObjContent11.style.display = 'block';
  display();
  //Ext.show(ansId);
 }

I want to be able to call display function from another function that is outside of ext (ex: fnDisplayAnswer)
Reply With Quote
  #2  
Old 11-07-2009, 03:07 AM
Condor's Avatar
Condor Condor is online now
Ext JS - Community Support Team
 
Join Date: Mar 2007
Location: The Netherlands
Posts: 14,250
Condor is on a distinguished road
Default

You'll have to create a global function. To keep things clean you should put these kinds of globals in your own namespace, e.g.

Ext.ns('mynamespace');
mynamespace.display = function(){
  spot.show("answerParticipant_faq10");
}
...
mynamespace.display();
__________________
Condor
Reply With Quote
  #3  
Old 11-07-2009, 03:17 AM
rehanqu rehanqu is offline
Ext JS Premium Member
 
Join Date: Jul 2009
Posts: 10
rehanqu is on a distinguished road
Default How to call a function with in Ext

thanks condor for your help...it works !!!
Reply With Quote
Reply

Thread Tools

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

All times are GMT -5. The time now is 03:24 AM.

© 2006-2009 Ext, LLC
Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.