1. #1
    Sencha User genius551v's Avatar
    Join Date
    Mar 2007
    Posts
    287
    Vote Rating
    0
    genius551v is on a distinguished road

      0  

    Default a little help with Dialog.....

    a little help with Dialog.....


    Hey jack i need a little help....

    I have this code...

    .
    .
    .
    <link href="web/css/Jack/reset-min.css" rel="stylesheet" type="text/css">
    <link href="web/css/Jack/style.css" rel="stylesheet" type="text/css">
    <link href="web/css/Jack/container.css" rel="stylesheet" type="text/css">

    <script language="JavaScript" src="web/js/Jack/yui.js"></script>
    <script language="JavaScript" src="web/js/Jack/yui-ext_32_1.js"></script>
    <script language="JavaScript" src="web/js/Jack/navbar.js"></script>
    <script language="JavaScript" src="web/js/Jack/blog.js"></script>

    <script language="JavaScript" src="web/js/Jack/jack_popup.js"></script>
    <script language="JavaScript" src="web/js/Jack/container-min.js"></script>
    .
    .
    .

    ....
    <TD style="VERTICAL-ALIGN: top; WIDTH: 200px" vAlign=top align=right><SPAN id=signin>[img]web/images/Jack/signin.gif[/img]</SPAN></TD>
    ....



    <DIV id=loginBox style="VISIBILITY: hidden">
    <DIV class=hd>Forum Sign In</DIV>
    <DIV class=bd>
    <IFRAME id="popup" name="popup" src="http://localhost" frameBorder=0></IFRAME>
    </DIV>
    </DIV>

    .
    .
    .

    the popup is implemented used the --> signin in forum.js <-- like example.

    I modify that and stay this....

    <jack_popup.js>

    function show_popup(){

    w = '400px';

    h = '400px';

    var loginDlg;

    loginDlg = new YAHOO.widget.Dialog("loginBox",{ modal:true, visible:false, width:w, height: h, fixedcenter:true, constraintoviewport:true, draggable:true, zIndex:10001 });

    loginDlg.render();

    loginDlg.show();
    }

    Ok, my problem is this:

    Firts time execute all works rigth, when i close the popup and execute second time (no reload the pag, just onclick the button) the popup show in diferents cordenates ¡? x,y on screen

    some idea?

    Tnks

  2. #2
    Sencha User jack.slocum's Avatar
    Join Date
    Mar 2007
    Location
    Tampa, FL
    Posts
    6,955
    Vote Rating
    16
    jack.slocum will become famous soon enough

      0  

    Default


    For a dialog that can be shown more than once, it makes sense to reuse the same dialog instance. If you look at forum.js you will see I am not actually creating it twice. I only create it if it doesn't already exist. This way my second call to show() just displays the same dialog.

    Code:
    if(!loginDlg){ // if it wasn't already created
        loginDlg = new YAHOO.widget.Dialog(...); 
        // create dialog
        loginDlg.render();
    }
    loginDlg.show(); // show the dialog
    My guess as to why your dialog is appearing in a different spot the second time around is because the old dialog is still there. That's just a guess though.

  3. #3
    Sencha User genius551v's Avatar
    Join Date
    Mar 2007
    Posts
    287
    Vote Rating
    0
    genius551v is on a distinguished road

      0  

    Default Tnks....somenting else...

    Tnks....somenting else...


    Hey tnks, this works great.

    But i have a question: if i want to have many Dialog in the same pag, how works? i will have destroy the var loginDlg ?? how??

    tnks

  4. #4
    Ext User
    Join Date
    Mar 2007
    Posts
    321
    Vote Rating
    0
    jbowman is on a distinguished road

      0  

    Default


    You wouldn't want multiple instances with the same id? For each dialog you'd give it a unique id.

    As for destroying containers, Module has a destroy function that I believe most of the containers inherit.

    http://developer.yahoo.com/yui/docs/...e.html#destroy

  5. #5
    Sencha User genius551v's Avatar
    Join Date
    Mar 2007
    Posts
    287
    Vote Rating
    0
    genius551v is on a distinguished road

      0  

    Default little help....

    little help....


    Hi,

    I have this code...

    var loginDlg;

    --> jack_popup.js <--

    function show_popup(src){
    w = '400px';
    h = '400px';

    var iframe = document.getElementById('popup_frame');
    iframe.setAttribute("src",src);

    //permite ver la asignacion del evento (**)
    //myValue = iframe.getAttribute("src");
    //alert("src: "+myValue);

    if(!loginDlg)
    {
    loginDlg = new YAHOO.widget.Dialog("popup",{ modal:true, visible:false, width:w, height: h, fixedcenter:true, constraintoviewport:true, draggable:true, zIndex:10001 });
    loginDlg.render();
    }
    loginDlg.show();
    return;
    }

    ok, lo q hago es pasarle src = la ruta q quiero q muestre el iframe dentro del popup
    asi puedo cada vez llamar el mismo loginDlg cambiando lo q muestra.

    el HTML esta asi.
    <head>
    <title>Empleado</title>
    <link href="web/css/Jack/reset-min.css" rel="stylesheet" type="text/css">
    <link href="web/css/Jack/style.css" rel="stylesheet" type="text/css">
    <link href="web/css/Jack/container.css" rel="stylesheet" type="text/css">

    <script language="JavaScript" src="web/js/Jack/yui.js"></script>
    <script language="JavaScript" src="web/js/Jack/yui-ext_32_1.js"></script>
    <script language="JavaScript" src="web/js/Jack/forum.js"></script>
    <script language="JavaScript" src="web/js/Jack/container-min.js"></script>
    .
    .
    .
    </head>
    <body>
    .
    .
    .

    --> ESTO ES PARA LANZAR UN POPUP CON UN URL <-- 1
    <SPAN id=signin>[img]web/images/Jack/signin.gif[/img]</SPAN>

    --> ESTO ES PARA LANZAR OTRO POPUP CON OTRO URL <-- 2
    <input type="button" name="pop" value="pop" onclick="show_popup('index.php?action=BIMBIPDMCmdDefaultEstado_registro_jornada'); event.returnValue = false;">

    --> ESTO ES CONTENEDOR DEL POPUP (TIENE UN IFRAME ALLI MUESTRO LO Q QUIERO)<-- 3

    <DIV id=popup style="VISIBILITY: hidden">
    <DIV class=hd id="titulo_popup">...</DIV>
    <DIV class=bd>
    <IFRAME id="popup_frame" name="popup_frame" style="WIDTH: 100%; HEIGHT: 100%; PADDING-TOP: 0px; PADDING-BOTTOM: 0px;" frameBorder=0></IFRAME>
    </DIV>
    </DIV>


    </body>

    My problem is:

    1. Cuando abro 1 -> cierro ->abro 2, la barra de estatus del ie se queda cargado.....como si estuviera buscando algo mas pero la pag dentro del iframe ya abrio completa. Que puede ser esto?
    si habilito el alert en el js (**) NO SUCEDE!

    2. la primera vez q pinta la pantalla (html) parece q pintara el div del popup porque la pantalla sale con scrolls pero no se muestra el contenido y cuando abro el popup se redimenciona el iframe y ya queda normal.

    Alguna idea q me pueda ayudar con esto???

    Gracias!

  6. #6
    Ext User
    Join Date
    Mar 2007
    Posts
    3
    Vote Rating
    0
    Shayne is on a distinguished road

      0  

    Default


    Sorry for the thread resurrection, however I'm having a problem with this panel thing as well.

    I was hoping to use a single panel for all "image popups" on my entire website. So i created a simple function to do so:

    Code:
    function show_image_panel(image, caption, width) {
    	image_panel = new YAHOO.widget.Panel("win",{width: width, fixedcenter: true, underlay:"none", constraintoviewport: true, close:true, visible:false, draggable:false, modal:true});
    	image_panel.setHeader(caption); 
    	image_panel.setBody("[img][/img]"); 
    	image_panel.render();
    	image_panel.show();
    }
    This works great initially but the second image thats clicked has the panel in a different location. The third time its clicked the panel appears outside of the screen. This post says to only build the panel once and just show it, unfortunately this wont work as i have to change values of the pop up before showing.

    A pointing in the right direction would be great. Thanks.

  7. #7
    Ext User
    Join Date
    Mar 2007
    Posts
    3
    Vote Rating
    0
    Shayne is on a distinguished road

      0  

    Default


    image_panel.render(document.body);

    ...appears to solve the long term problem, but the original click appears too low where as all subsequent clicks make the images appear in the middle as they should.

  8. #8
    Sencha User jack.slocum's Avatar
    Join Date
    Mar 2007
    Location
    Tampa, FL
    Posts
    6,955
    Vote Rating
    16
    jack.slocum will become famous soon enough

      0  

    Default


    You can update everything each time still reusing the same panel. Creating a new panel from scratch doesn't make a lot of sense when all you need is to update the contents. Just call setHeader() setBody() and you can also update config values using panel.cfg.setProperty().

  9. #9
    Ext User
    Join Date
    Mar 2007
    Posts
    3
    Vote Rating
    0
    Shayne is on a distinguished road

      0  

    Default


    Thanks for the help on the config! I didn't realize i could do that, and after checking out more examples on yahoo i cant believe i missed it.

    Code:
    var image_popup;
    
    function popup(image, caption, width, height){
    	if(!image_popup){
    		image_popup = new YAHOO.widget.Panel("image_popup", {width: width, height: height, fixedcenter: true, underlay:"none", constraintoviewport: true, close:true, visible:false, draggable:false, modal:true});
    		image_popup.render();
    	}
    	image_popup.setHeader(caption); 
    	image_popup.setBody("[img][/img]"); 
    	image_popup.cfg.setProperty('width',width);
    	image_popup.cfg.setProperty('height',height);
    	image_popup.show();
    }
    Thanks for the help again, saved me a lot of time and frustration I'm sure.

  10. #10
    Sencha User jack.slocum's Avatar
    Join Date
    Mar 2007
    Location
    Tampa, FL
    Posts
    6,955
    Vote Rating
    16
    jack.slocum will become famous soon enough

      0  

    Default


    No problem. I'm glad it worked for you.

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar