Guest User

232812-win-8-1-ie11-possible-memory-leak

a guest
Nov 18th, 2015
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.30 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Leak</title>
  6.  
  7. <script>
  8. window.isc_useSimpleNames = false;
  9. var isomorphicDir = "./isomorphic/";
  10. </script>
  11.  
  12. <script src="./isomorphic/system/modules/ISC_Core.js"></script>
  13. <script src="./isomorphic/system/modules/ISC_Foundation.js"></script>
  14. <script src="./isomorphic/system/modules/ISC_Containers.js"></script>
  15. <script src="./isomorphic/system/modules/ISC_Grids.js"></script>
  16. <script src="./isomorphic/system/modules/ISC_Forms.js"></script>
  17. <script src="./isomorphic/system/modules/ISC_DataBinding.js"></script>
  18. <script src="./isomorphic/system/modules/ISC_Calendar.js"></script>
  19.  
  20. <script src="./isomorphic/skins/Enterprise/load_skin.js"></script>
  21.  
  22. <script>
  23. // Setting auto draw to false so the elements are not draw unnecessarily
  24. isc.setAutoDraw(false);
  25. </script>
  26.  
  27. <script>
  28. var STATUS = ["Status 1", "Status 2", "Status 3", "Status 4", "Status 5"];
  29. var FLAGS = ["flag1", "flag2", "flag3"];
  30. var TRUE_FALSE = [true, false];
  31. var DESCRIPTION = [
  32. "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed cursus diam eu nulla tincidunt efficitur. Sed laoreet sed risus sit amet eleifend.",
  33. "Nunc justo tellus, consectetur at ullamcorper non, bibendum eu nunc. Ut fringilla mauris a ligula consectetur, vitae consectetur orci condimentum.",
  34. "Sed ut malesuada ante. Praesent vulputate, ex sed mollis interdum, justo leo malesuada ex, et suscipit mi nulla et lectus."
  35. ];
  36.  
  37. function getDataSource() {
  38. isc.DataSource.create({
  39. ID: "dataSource",
  40. clientOnly: true,
  41. fields:[{
  42. name: "enabled",
  43. title: "Enabled",
  44. type: "boolean"
  45. },{
  46. name: "name",
  47. title: "Name",
  48. type: "text"
  49. },{
  50. name: "status",
  51. title: "Status",
  52. type: "text"
  53. },{
  54. name: "description",
  55. title: "Description",
  56. type: "text"
  57. },{
  58. name: "flag",
  59. title: "Flag",
  60. type: "text",
  61. showIf: "false"
  62. }]
  63. });
  64. return dataSource;
  65. }
  66.  
  67. function getListGrid() {
  68. isc.ListGrid.create({
  69. ID: "listGrid",
  70. autoDraw: true,
  71. width: "100%",
  72. height: "100%",
  73. headerHeight: 30,
  74. cellHeight: 30,
  75. dataSource: getDataSource(),
  76. groupStartOpen: "all",
  77. canCollapseGroup: false,
  78. quickDrawAheadRatio: 4.0,
  79. wrapCells: false,
  80. fixedRecordHeights: true,
  81. autoFetchData: false,
  82. canResizeFields: false,
  83. canAutoFitFields: false,
  84. canReorderFields: false,
  85. alternateRecordStyles: true,
  86. virtualScrolling: false,
  87. showHeaderContextMenu: false,
  88. showAsynchGroupingPrompt: false,
  89. emptyMessage: "Empty list",
  90. loadingDataMessage : "Loading",
  91. groupByField: "flag",
  92. sortField: "name",
  93. hilites: getHilites(),
  94. groupByAsyncThreshold: 600
  95. });
  96.  
  97. listGrid.filterData(getFilter());
  98.  
  99. periodicallyUpdate();
  100. }
  101.  
  102. function updateListGrid() {
  103. dataSource.setCacheData(getData());
  104. listGrid.invalidateCache();
  105. }
  106.  
  107. function periodicallyUpdate() {
  108. updateListGrid();
  109.  
  110. setTimeout("periodicallyUpdate()", 500);
  111. };
  112.  
  113. function getData() {
  114. var data = [];
  115.  
  116. for (var i = 0; i < 200; i++) {
  117. data.push(getEntry(i));
  118. }
  119.  
  120. return data;
  121. }
  122.  
  123. function getEntry(index) {
  124. var dataEntry = {};
  125.  
  126. dataEntry.id = index;
  127. dataEntry.enabled = randomValue(TRUE_FALSE);
  128. dataEntry.name = "data " + index + " " + Math.floor(Math.random() * 10);
  129. dataEntry.timeout = Date.now();
  130. dataEntry.flag = randomValue(FLAGS);
  131. dataEntry.description = randomValue(DESCRIPTION);
  132. dataEntry.status = randomValue(STATUS);
  133.  
  134. return dataEntry;
  135. }
  136.  
  137. function getFilter() {
  138. return {
  139. fieldName: "status",
  140. operator: "notEqual",
  141. value: "Status 4"
  142. };
  143. }
  144.  
  145. function getHilites() {
  146.  
  147. var hiliteArray = [{
  148. fieldName: [
  149. "enabled",
  150. "name",
  151. "status",
  152. "description"
  153. ],
  154. cssText: "cursor: pointer;",
  155. criteria: {
  156. fieldName: "enabled",
  157. operator: "equals",
  158. value: true
  159. }
  160. },{
  161.  
  162. fieldName: "name",
  163. cssText: "line-height: 20px;",
  164. criteria: {
  165. fieldName: "name",
  166. operator: "notEqual",
  167. value: ""
  168. }
  169. }];
  170.  
  171. return hiliteArray;
  172. }
  173.  
  174. function randomValue(list) {
  175. return list[Math.floor(Math.random() * list.length)];
  176. }
  177.  
  178. </script>
  179. </head>
  180.  
  181. <body>
  182. <script>
  183. getListGrid();
  184. </script>
  185. </body>
  186. </html>
Advertisement
Add Comment
Please, Sign In to add comment