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

Re: Layout Manager and dataSrc element

Expand Messages
  • djhelleur
    ... same way ... one ... Well ok, I decided to start over from scratch and use a YUI example - Layout inside a resizable Panel. Here is the function with my
    Message 1 of 3 , Nov 14, 2008
    • 0 Attachment
      --- In ydn-javascript@yahoogroups.com, "Dav Glass" <dav.glass@...>
      wrote:
      >
      > djhelleur --
      >
      > I didn't get a chance to make an official example, but it works the
      same way
      > that the TabView example does:
      > http://developer.yahoo.com/yui/examples/tabview/datasrc.html
      >
      > Dav
      >
      >
      > --
      > Dav Glass
      > dav.glass@...
      > blog.davglass.com
      >
      >
      > + Windows: n. - The most successful computer virus, ever. +
      > + A computer without a Microsoft operating system is like a dog
      > without bricks tied to its head +
      > + A Microsoft Certified Systems Engineer is to computing what a
      > McDonalds Certified Food Specialist is to fine cuisine +
      >
      >
      > On Thu, Nov 13, 2008 at 1:59 PM, djhelleur <djhelleur@...> wrote:
      >
      > > I must be missing something somewhere. Can someone point me to an
      > > example where a layout manager element loads an external file in
      one
      > > (or more) of it's unit elements?
      > >
      > > TIA
      > >
      > >
      > > ------------------------------------
      > >
      > > Yahoo! Groups Links
      > >
      > >
      > >
      > >
      >

      Well ok, I decided to start over from scratch and use a YUI example -
      Layout inside a resizable Panel. Here is the function with my
      attempt at the datasrc parameter. The graphic_roster.html file is
      in the same directory as this file. All I get is a test panel with
      top, left, and bottom sections and no center. What am I missing?
      ++++++++++++++++++++++++++

      combo-handled YUI JS files:
      src="http://yui.yahooapis.com/combo?
      2.6.0/build/utilities/utilities.js&2.6.0/build/container/container-
      min.js&2.6.0/build/datasource/datasource-
      min.js&2.6.0/build/resize/resize-min.js&2.6.0/build/layout/layout-
      min.js">

      function in the body of my test file:
      (function() {
      var Dom = YAHOO.util.Dom,
      Event = YAHOO.util.Event,
      layout = null,
      resize = null;

      Event.onDOMReady(function() {
      var panel = new YAHOO.widget.Panel('demo', {
      draggable: true,
      close: false,
      autofillheight: "body", // default value, specified here
      to highlight its use in the example
      underlay: 'none',
      width: '500px',
      xy: [100, 100]
      });
      panel.setHeader('Test Panel');
      panel.setBody('<div id="layout"></div>');
      panel.beforeRenderEvent.subscribe(function() {
      Event.onAvailable('layout', function() {
      layout = new YAHOO.widget.Layout('layout', {
      height: 400,
      width: 480,
      units: [
      { position: 'top', height: 25, resize: false,
      body: 'Top', gutter: '2' },
      { position: 'left', width: 150, resize: true,
      body: 'Left', gutter: '0 5 0 2', minWidth: 150, maxWidth: 300 },
      { position: 'bottom', height: 25,
      body: 'Bottom', gutter: '2' },
      { position: 'center', gutter: '0 2 0 0',
      dataSrc: 'graphic_roster.html' }
      ]
      });

      layout.render();
      });
      });
      panel.render();
      resize = new YAHOO.util.Resize('demo', {
      handles: ['br'],
      autoRatio: true,
      status: false,
      minWidth: 380,
      minHeight: 400
      });
      resize.on('resize', function(args) {
      var panelHeight = args.height,
      padding = 20;
      //Hack to trick IE into behaving
      Dom.setStyle('layout', 'display', 'none');
      this.cfg.setProperty("height", panelHeight + 'px');
      layout.set('height', this.body.offsetHeight - padding);
      layout.set('width', this.body.offsetWidth - padding);
      //Hack to trick IE into behaving
      Dom.setStyle('layout', 'display', 'block');
      layout.resize();

      }, panel, true);
      });
      })();
    Your message has been successfully submitted and would be delivered to recipients shortly.