Sha256: dfa51a9acc644b6c863dfeba50718e1024396737c7bcf782c17f77b5e6d04e7d
Contents?: true
Size: 1.03 KB
Versions: 7
Compression:
Stored size: 1.03 KB
Contents
You should be able to sort the TR elements of this table, though the input and button elements should keep working. <table id="sortablesTable"> <tbody> <tr> <td><a href="#">row 1</a></td> <td><button>R1</button></td> <td>row 1</td> <td><input type="button"></td> </tr> <tr> <td><a href="#">row 2</a></td> <td><button>R2</button></td> <td><input type="text"></td> </tr> <tr> <td><a href="#">row 3</a></td> <td><button>R3</button></td> <td>row 3</td> </tr> </tbody> </table> <div id="result"></div> <script src="/depender/build?require=More/Sortables"></script> <script> thisSortables1 = new Sortables($('sortablesTable').getElement('tbody'), { constrain: true, clone: false, snap: 6, revert: true }); $$('#sortablesTable button').addEvent('click', function(e){ $('result').adopt(new Element('p', {text: 'Clicked:' + e.target.get('text')})); }); $$('#sortablesTable a').addEvent('click', function(e){ $('result').adopt(new Element('p', {text: 'Clicked:' + e.target.get('text')})); }); </script>
Version data entries
7 entries across 7 versions & 1 rubygems