ENART.HZRP.COM
welcome to my space
X
NAVIGATION - HOME
Search:  
[Solved]Show() and Confirm() return value
Published by: jane 2009-07-04
  • My problem is very simple as i am a newbie...

    I want to display a confirmation dialog that appear when i click on a link : if the user clicks 'Yes' he continues, if he clicks 'NO' he cancel his request.

    I found that message boxes were asynchronous so I got to use show method, so I code this :

    confirmResult = function(btn) {
    if (btn == 'ok')
    {
    return true ;
    }
    return false ;
    }

    Ext.onReady(function() {
    Ext.get('logout').on('click', function(e){
    e.stopEvent() ;
    Ext.Msg.show({
    title: 'Confirmation',
    msg: 'Are You sure ?',
    buttons: Ext.Msg.YESNO,
    fn: confirmResult,
    animeId: this,
    icon: Ext.Msg.QUESTION
    }) ;
    });
    }) ;


    When there isn't stopEvent() the user is always redirected, but when there is stopEvent(), nothing happen.

    Someone could help me ? I just want to do something simple : ExtJS


  • Ok I finally got my response by myself : http://extjs.com/learn/Manual:Widgets:MessageBox

    This is what i code :

    Ext.get('elId').on('click', function(e, target){
    Ext.Msg.confirm('Go to this website...',
    'Are You sure ?',
    function(btn) {
    if (btn == 'yes')
    {
    document.location = target.href ;
    }
    }) ;
    }, this, {stopEvent: true});





  • Newbie Question: Form Submit is not loading the action file
    set FieldValue by Formload
    PRINT Add to favorites
  • i have a question about getting help for depression
  • have you read the draft of midnight sun
  • does he like me wq inside
  • what bands will i like easssyyyyyyy
  • careers with a major in forestry
  • am i over reacting about this
  • would celebrities like it if they have no fans
  • ladies is tickling a girl 039 s barefeet a means of flirting with her
  • should i stay single or go out wid somebody
  • ecology guyss helpp please
  • how can i melt down recyclables like plastic
  • i have a friend thats a girl how do i ask her out
  • can 039 t sleep having hateful thoughts what 039 s wrong with me
  • what happens if chuck norris punches himself
  • how do i burn this onto a cd please im begging you

  • what is the reason for racist beings
  • if ww3 breaks out in the u s are you prepared what would you do
  • what are you most proud of yourself for right this moment
  • ok girls and guys help me
  • i don 039 t want any gifts for christmas this year from my family
  • why do some religionists insist that marriage is exclusively based on religion
  • open for guys and girls be honest love advice
  • good rockish punkish songs
  • do girls like chest hair
  • help me please im going crazy
  • is this a good name for our band
  • why do i hate new things
  • should i invite her
  • brightness and the sun makes me weak why do i prefer the dark

  • About us |Contact us |Advertisement |Site map |Exchange links
    Copyright© 2008enart.hzrp.com All Rights Reserved