Search the web
Sign In
New User? Sign Up
ydn-javascript · Yahoo! User Interface Library Group
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Real people. Real stories. See how Yahoo! Groups impacts members worldwide.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Dynamically resizing YUI grids?   Message List  
Reply | Forward Message #31102 of 52127 |
Re: [ydn-javascript] Dynamically resizing YUI grids?

braz_ford,

All of your scripts have access to all elements on the page.  Because you know the id attribute of the element that controls the width of the grid, you can get a reference to it in JavaScript and then change the id.

Here's a quickie example:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
<html>
<head>
   <title>Modifying Grid Width Scriptologically</title>
   <link rel="stylesheet" href="http://yui.yahooapis.com/2.5.1/build/grids/grids.css" type="text/css">
   <style>
   .yui-t7 {background-color:#CCCCFF;}
   </style>
</head>
<body>
<div id="doc" class="yui-t7 root">
   <div id="hd"><h1>Modifying Grid Width Scriptologically</h1></div>
   <div id="bd">
<div class="yui-g">
     <p><a href="#" id="" class="docswitch">doc</a></p>
     <p><a href="#" id="2" class="docswitch">doc2</a></p>
     <p><a href="#" id="3" class="docswitch">doc3</a></p>
     <p><a href="#" id="4" class="docswitch">doc4</a></p>
    
</div>

</div>
   <div id="ft"></div>
</div>


<script language="javascript">
(function() {
var root = document.getElementById("doc");
var setRoot = function(e) {
root.id = ("doc" + YAHOO.util.Event.getTarget(e).id);
}
YAHOO.util.Event.on(YAHOO.util.Dom.getElementsByClassName("docswitch", "a"), "click", setRoot);
})();
</script>
</body>
</html>


Regards,
Eric


On May 16, 2008, at 5:06 PM, braz_ford wrote:

I have an application with a relatively static header and I need to 
update the yahoo gris body <div id="bd"> with an AJAX call. Since the 
grid template information is in the main div, which is outside the 
scope of the bd div, I'm not saure how I can switch grid column 
settings using AJAX.




Sat May 17, 2008 12:44 am

ericmiraglia
Online Now Online Now
Send Email Send Email

Forward
Message #31102 of 52127 |
Expand Messages Author Sort by Date

I have an application with a relatively static header and I need to update the yahoo gris body <div id="bd"> with an AJAX call. Since the grid template...
braz_ford
Offline Send Email
May 17, 2008
12:06 am

braz_ford, All of your scripts have access to all elements on the page. Because you know the id attribute of the element that controls the width of the grid,...
Eric Miraglia
ericmiraglia
Online Now Send Email
May 17, 2008
12:45 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help