Loading ...
Sorry, an error occurred while loading the content.
 

Panel is not shown in right localtion

Expand Messages
  • hoyenko
    I create a panel like this: YAHOO.paneledit = new YAHOO.widget.Panel( paneledit , { width: 550px , visible:false, constraintoviewport:true, modal:true} );
    Message 1 of 2 , Dec 28, 2006
      I create a panel like this:

      YAHOO.paneledit = new YAHOO.widget.Panel("paneledit", {
      width:"550px", visible:false, constraintoviewport:true, modal:true} );
      YAHOO.paneledit.cfg.queueProperty("keylisteners",
      new YAHOO.util.KeyListener(document, { keys : 27 },
      {fn:function()
      {this.hide();},scope:YAHOO.paneledit,correctScope:true} ));


      then modify the body and show it

      YAHOO.paneledit.cfg.setProperty('context', ['mainPanel', 'tl', 'tl']);
      YAHOO.paneleditrender(document.body);
      YAHOO.paneledit.show();

      The problem is that the first time I show it it is not in the right
      place (outside the IE window, I can only close it by Esc). If I hide
      it and show it again it appears in the right place. In Firefox it
      would be shown in the browser window but not in the correct place the
      first time and in the right place the next time.

      Do you know why would it happen and how to fix it?

      Thanks,
      Roman
    • Steven Peterson
      Roman, Usually when you set the context of a Panel, you need to make certain that the context element is already in its final position in the DOM. Are you
      Message 2 of 2 , Dec 29, 2006

        Roman,

         

        Usually when you set the context of a Panel, you need to make certain that the context element is already in its final position in the DOM. Are you waiting until the document has finished loading to position the Panel anchored to the context element? That’s the best way to get the Panel to position itself correctly.

         

        Steven Peterson

        Web Developer, Platform Engineering

        Yahoo!

         

        From: ydn-javascript@yahoogroups.com [mailto:ydn-javascript@yahoogroups.com] On Behalf Of hoyenko
        Sent: Thursday, December 28, 2006 4:51 PM
        To: ydn-javascript@yahoogroups.com
        Subject: [ydn-javascript] Panel is not shown in right localtion

         

        I create a panel like this:

        YAHOO.paneledit = new YAHOO.widget.Panel("paneledit", {
        width:"550px", visible:false, constraintoviewport:true, modal:true} );
        YAHOO.paneledit.cfg.queueProperty("keylisteners",
        new YAHOO.util.KeyListener(document, { keys : 27 },
        {fn:function()
        {this.hide();},scope:YAHOO.paneledit,correctScope:true} ));

        then modify the body and show it

        YAHOO.paneledit.cfg.setProperty('context', ['mainPanel', 'tl', 'tl']);
        YAHOO.paneleditrender(document.body);
        YAHOO.paneledit.show();

        The problem is that the first time I show it it is not in the right
        place (outside the IE window, I can only close it by Esc). If I hide
        it and show it again it appears in the right place. In Firefox it
        would be shown in the browser window but not in the correct place the
        first time and in the right place the next time.

        Do you know why would it happen and how to fix it?

        Thanks,
        Roman

      Your message has been successfully submitted and would be delivered to recipients shortly.