3 Level Chaining Revision 5c7a7910bf4c (Tue Dec 16 2008 at 17:23) - Diff Link to this snippet: https://friendpaste.com/3XOuUq1pXFNG6No8OzHjEX Embed: manni perldoc borland colorful default murphy trac fruity autumn bw emacs pastie friendly Show line numbers Wrap lines 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><title>Chain.js Example 3</title><script src="../lib/jquery-1.2.6.pack.js" language="javascript"></script><script src="../build/chain.js" language="javascript"></script><script type="text/javascript"> $(document).ready(function(){ $('#tables').chain(function(){ var self = this; var tbody = self.find('tbody'); tbody.chain(); self.update(function(){ var data = self.item(); tbody.items('replace', data.rows); }); }); $('#tables').items([ {level:"Level1", head1:"Col1", head2:"Col2", head3:"Col3", rows:[ {col1:"Some Data", col2:"A", col3:"B"}, {col1:"Some Data", col2:"A", col3:"B"}, {col1:"Some Data", col2:"A", col3:"B"} ]}, {level:"Level2", head1:"Col1", head2:"Col2", head3:"Col3", rows:[ {col1:"Some Data", col2:"A", col3:"B"}, {col1:"Some Data", col2:"A", col3:"B"}, {col1:"Some Data", col2:"A", col3:"B"} ]}, {level:"level3", head1:"Col1", head2:"Col2", head3:"Col3", rows:[ {col1:"Some Data", col2:"A", col3:"B"}, {col1:"Some Data", col2:"A", col3:"B"}, {col1:"Some Data", col2:"A", col3:"B"} ]} ]); });</script></head><body> <div id="tables"> <table> <thead> <tr><th class="level" colspan="3">Level</th></tr> <tr> <th class="head1">Col1</th> <th class="head2">Col2</th> <th class="head3">Col3</th> </tr> </thead> <tbody> <tr> <td class="col1">some data</td> <td class="col2">A</td> <td class="col3">B</td> </tr> </tbody> </table> </div></body></html>