[ 2 posts ]

Yauhen Filipskikh

  • Username: NecroFilja
  • Joined: Mon Sep 14, 2009 1:12 am
  • Posts: 9
  • Offline
  • Profile

Dialog resize and move

Post Posted: Mon Sep 14, 2009 1:56 am
+0-
Hello all,

I am very novice in YUI library (but have some expirience with jquery ui) so ma be question ios stupid.
Could you please clarify following scenario:
I have created YUI dialog:
searchDialog = new YAHOO.widget.Dialog("searchPanel",
{ width: currentSettings.Width,
height: currentSettings.Height,
visible: false,
constraintoviewport: true,
xy: [currentSettings.HorizontalPos, currentSettings.VerticalPos],
buttons: [],
hideaftersubmit: false,
postmethod: 'form',
close: false
});
searchDialog.render();
searchDialog.show();


then in some event I need to move it to some position and change its size. I haven't found any standard methods like resize or move so my idea is following:
1) to move dialog control just: YAHOO.util.Dom.setXY(searchDialog.element, [0, 0]);
2) to resize it searchDialog.element.style.height = newHeight + 'px';

are these soultions correct? Or may be dialog adds some overhead and these solutions should be improved (because in jquery ui correct solution is to use some internal functions like size, position)?

Dav Glass

  • Username: davglass
  • Joined: Thu Aug 28, 2008 9:28 am
  • Posts: 2088
  • Location: Marion, IL, US
  • Twitter: davglass
  • GitHub: davglass
  • Gists: davglass
  • IRC: davglass
  • Offline
  • Profile
Tags:

Re: Dialog resize and move

Post Posted: Mon Sep 14, 2009 5:48 am
+0-
You should use the Dialogs built in configuration attributes for this:

Code:
searchDialog.cfg.setProperty('xy', [0,0]);
searchDialog.cfg.setProperty('height', newHeight + 'px');
  [ 2 posts ]
Display posts from previous:  Sort by  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum