Posted By

jvandemerwe on 03/09/11


Tagged

scope extjs messagebox ExtMsg cheating


Versions (?)

Extjs - Additional values to a Ext.Msg.Show (cheating scope)


 / Published in: ActionScript
 

  1. // following example comes from a drag drop implementation in a grid, which
  2. // requires a YES/NO answer on a messagebox, but we would like to add some
  3. // extra's as a parameter to the function where we test the answer
  4.  
  5.  
  6. /*--------------------------------------------------------------------------
  7.   * Drag and Drop event Handlers
  8.   *-------------------------------------------------------------------------*/
  9.  
  10. ProcessDropping : function (ddSource, data, obj) {
  11.  
  12. Ext.Msg.show({
  13. title : zap.getLang('plan', 'delete_event','Ereignis zufügen?'),
  14. msg : zap.getLang('plan', 'q_delete_event','Soll dieses Ereignis zugefügt werden?'),
  15. buttons : Ext.Msg.YESNO,
  16. config : {
  17. obj : obj,
  18. myname : 'nobody'
  19. },
  20. fn : this.ProcessDroppingContinue,
  21. icon : Ext.MessageBox.QUESTION
  22. });
  23. },
  24.  
  25. ProcessDroppingContinue : function (btn, text, opt ) {
  26. var obj = opt.config.obj; // = obj from the parameters of the other routine
  27. var cowboy = opt.config.myname // = nobody
  28.  
  29. if (btn === 'yes' ) {
  30. // do something very nice here
  31. }
  32. }
  33.  

Report this snippet  

You need to login to post a comment.