memory_leak.html 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset='utf-8'>
  5. <title>Memory leak investigation - Handsontable</title>
  6. <!--
  7. Loading Handsontable (full distribution that includes all dependencies)
  8. -->
  9. <script data-jsfiddle="common" src="js/numeral.de-de.js"></script>
  10. <link data-jsfiddle="common" rel="stylesheet" media="screen" href="../dist/handsontable.css">
  11. <link data-jsfiddle="common" rel="stylesheet" media="screen" href="../dist/pikaday/pikaday.css">
  12. <script data-jsfiddle="common" src="../dist/pikaday/pikaday.js"></script>
  13. <script data-jsfiddle="common" src="../dist/moment/moment.js"></script>
  14. <script data-jsfiddle="common" src="../dist/zeroclipboard/ZeroClipboard.js"></script>
  15. <script data-jsfiddle="common" src="../dist/numbro/numbro.js"></script>
  16. <script data-jsfiddle="common" src="../dist/numbro/languages.js"></script>
  17. <script data-jsfiddle="common" src="../dist/handsontable.js"></script>
  18. <!--
  19. Loading demo dependencies. They are used here only to enhance the examples on this page
  20. -->
  21. <link data-jsfiddle="common" rel="stylesheet" media="screen" href="css/samples.css?20140331">
  22. </head>
  23. <body>
  24. <div class="wrapper">
  25. <div class="wrapper-row">
  26. <div id="global-menu-clone">
  27. <h1><a href="../index.html">Handsontable</a></h1>
  28. </div>
  29. <div id="container">
  30. <div class="columnLayout">
  31. <div class="rowLayout">
  32. <div class="descLayout">
  33. <div class="pad" data-jsfiddle="example1">
  34. <a name="lazy"></a>
  35. <h2>Memory leak investigation</h2>
  36. <p>Click the button below to create and remove HOT instance</p>
  37. <div id="test"></div>
  38. <p>
  39. <button id="goGOT">
  40. Test memory leak!
  41. </button>
  42. </p>
  43. </div>
  44. </div>
  45. <script>
  46. var myData = [
  47. {"car": "Mercedes A 160", "year": 2006, "price": 6999.99},
  48. {"car": "Citroen C4 Coupe", "year": 2008, "price": 8330},
  49. {"car": "Audi A4 Avant", "year": 2011, "price": 33900},
  50. {"car": "Opel Astra", "year": 2004, "price": 7000},
  51. {"car": "BMW 320i Coupe", "year": 2011, "price": 30500}
  52. ],
  53. goGOT = document.getElementById('goGOT');
  54. Handsontable.dom.addEvent(goGOT, 'click', function () {
  55. var test = document.getElementById('test'),
  56. container = document.createElement('DIV'),
  57. hot;
  58. test.appendChild(container);
  59. hot = new Handsontable(container, {
  60. data: myData,
  61. startRows: 7,
  62. startCols: 4,
  63. colHeaders: ['Car', 'Year', 'Price ($)', 'Price (€)']
  64. });
  65. hot.destroy();
  66. test.removeChild(container);
  67. });
  68. </script>
  69. </div>
  70. <div class="footer-text">
  71. </div>
  72. </div>
  73. </div>
  74. </div>
  75. </div>
  76. <div id="outside-links-wrapper"></div>
  77. </body>
  78. </html>