Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8">
- <title>Leak</title>
- <script>
- window.isc_useSimpleNames = false;
- var isomorphicDir = "./isomorphic/";
- </script>
- <script src="./isomorphic/system/modules/ISC_Core.js"></script>
- <script src="./isomorphic/system/modules/ISC_Foundation.js"></script>
- <script src="./isomorphic/system/modules/ISC_Containers.js"></script>
- <script src="./isomorphic/system/modules/ISC_Grids.js"></script>
- <script src="./isomorphic/system/modules/ISC_Forms.js"></script>
- <script src="./isomorphic/system/modules/ISC_DataBinding.js"></script>
- <script src="./isomorphic/system/modules/ISC_Calendar.js"></script>
- <script src="./isomorphic/skins/Enterprise/load_skin.js"></script>
- <script>
- // Setting auto draw to false so the elements are not draw unnecessarily
- isc.setAutoDraw(false);
- </script>
- <script>
- var STATUS = ["Status 1", "Status 2", "Status 3", "Status 4", "Status 5"];
- var FLAGS = ["flag1", "flag2", "flag3"];
- var TRUE_FALSE = [true, false];
- var DESCRIPTION = [
- "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed cursus diam eu nulla tincidunt efficitur. Sed laoreet sed risus sit amet eleifend.",
- "Nunc justo tellus, consectetur at ullamcorper non, bibendum eu nunc. Ut fringilla mauris a ligula consectetur, vitae consectetur orci condimentum.",
- "Sed ut malesuada ante. Praesent vulputate, ex sed mollis interdum, justo leo malesuada ex, et suscipit mi nulla et lectus."
- ];
- function getDataSource() {
- isc.DataSource.create({
- ID: "dataSource",
- clientOnly: true,
- fields:[{
- name: "enabled",
- title: "Enabled",
- type: "boolean"
- },{
- name: "name",
- title: "Name",
- type: "text"
- },{
- name: "status",
- title: "Status",
- type: "text"
- },{
- name: "description",
- title: "Description",
- type: "text"
- },{
- name: "flag",
- title: "Flag",
- type: "text",
- showIf: "false"
- }]
- });
- return dataSource;
- }
- function getListGrid() {
- isc.ListGrid.create({
- ID: "listGrid",
- autoDraw: true,
- width: "100%",
- height: "100%",
- headerHeight: 30,
- cellHeight: 30,
- dataSource: getDataSource(),
- groupStartOpen: "all",
- canCollapseGroup: false,
- quickDrawAheadRatio: 4.0,
- wrapCells: false,
- fixedRecordHeights: true,
- autoFetchData: false,
- canResizeFields: false,
- canAutoFitFields: false,
- canReorderFields: false,
- alternateRecordStyles: true,
- virtualScrolling: false,
- showHeaderContextMenu: false,
- showAsynchGroupingPrompt: false,
- emptyMessage: "Empty list",
- loadingDataMessage : "Loading",
- groupByField: "flag",
- sortField: "name",
- hilites: getHilites(),
- groupByAsyncThreshold: 600
- });
- listGrid.filterData(getFilter());
- periodicallyUpdate();
- }
- function updateListGrid() {
- dataSource.setCacheData(getData());
- listGrid.invalidateCache();
- }
- function periodicallyUpdate() {
- updateListGrid();
- setTimeout("periodicallyUpdate()", 500);
- };
- function getData() {
- var data = [];
- for (var i = 0; i < 200; i++) {
- data.push(getEntry(i));
- }
- return data;
- }
- function getEntry(index) {
- var dataEntry = {};
- dataEntry.id = index;
- dataEntry.enabled = randomValue(TRUE_FALSE);
- dataEntry.name = "data " + index + " " + Math.floor(Math.random() * 10);
- dataEntry.timeout = Date.now();
- dataEntry.flag = randomValue(FLAGS);
- dataEntry.description = randomValue(DESCRIPTION);
- dataEntry.status = randomValue(STATUS);
- return dataEntry;
- }
- function getFilter() {
- return {
- fieldName: "status",
- operator: "notEqual",
- value: "Status 4"
- };
- }
- function getHilites() {
- var hiliteArray = [{
- fieldName: [
- "enabled",
- "name",
- "status",
- "description"
- ],
- cssText: "cursor: pointer;",
- criteria: {
- fieldName: "enabled",
- operator: "equals",
- value: true
- }
- },{
- fieldName: "name",
- cssText: "line-height: 20px;",
- criteria: {
- fieldName: "name",
- operator: "notEqual",
- value: ""
- }
- }];
- return hiliteArray;
- }
- function randomValue(list) {
- return list[Math.floor(Math.random() * list.length)];
- }
- </script>
- </head>
- <body>
- <script>
- getListGrid();
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment