-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathcode.html
More file actions
104 lines (91 loc) · 4.07 KB
/
code.html
File metadata and controls
104 lines (91 loc) · 4.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<!DOCTYPE HTML>
<html>
<head>
<link rel="stylesheet" type="text/css" media="screen" href="scripts/css/smoothness/jquery-ui-1.8.22.custom.css" />
<link rel="stylesheet" type="text/css" media="screen" href="scripts/jqgrid/css/ui.jqgrid.css" />
<style>
html, body {
margin: 0;
padding: 0;
font-family:sans-serif;
}
</style>
<script src="scripts/jqgrid/js/jquery-1.7.2.min.js" type="text/javascript"></script>
<script src="scripts/jqgrid/js/i18n/grid.locale-en.js" type="text/javascript"></script>
<script src="scripts/jqgrid/js/jquery.jqGrid.min.js" type="text/javascript"></script>
<script type="text/javascript">
var sqlcc_objects = []; // create array.
var codeCoverage = location.hash.replace('#','');
document.write('<scr' + 'ipt src="' + codeCoverage + '/sqlcc.js"></scr' + 'ipt>');
</script>
</head>
<body>
<iframe width="100%" height="600" src="empty.html" name="iframe" id="iframe" frameBorder="0"></iframe>
<table id="list4"></table>
<div id="pager2"></div>
<a href="default.html">Main</a>
<script>
function createLink(cell) {
name = cell.split(".")[1]
return '<a href="' + codeCoverage + '/' + cell + '.html" target="iframe">'+name+'</a>';
}
function roundNumber(num, dec) {
var result = Math.round(num*Math.pow(10,dec))/Math.pow(10,dec);
return result;
}
function percent(cell) {
return roundNumber(cell * 100,2);
}
jQuery("#list4").jqGrid({
datatype: "local",
height: 230,
colNames: ['Type', 'Schema', 'Object Name','FLOC', 'LOC','Characters', '% Covered'],
colModel: [
{name:'Type',index:'Type', width:10},
{name:'Schema',index:'Schema', width:5},
{name:'Name',index:'Name', width:65, formatter:createLink},
{name:'TotalFloc',index:'TotalFloc', width:5, sorttype:"int"},
{name:'TotalLoc',index:'TotalLoc', width:5, sorttype:"int"},
{name:'TotalCharacters',index:'TotalCharacters', width:5, sorttype:"int"},
{name:'CoveredPercent',index:'CoveredPercent', width:5, sorttype:"float",formatter:percent}
],
/*
colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'],
colModel:[
{name:'id',index:'id', width:60, sorttype:"int"},
{name:'invdate',index:'invdate', width:90, sorttype:"date"},
{name:'name',index:'name', width:100},
{name:'amount',index:'amount', width:80, align:"right",sorttype:"float"},
{name:'tax',index:'tax', width:80, align:"right",sorttype:"float"},
{name:'total',index:'total', width:80,align:"right",sorttype:"float"},
{name:'note',index:'note', width:150, sortable:false}
],*/
autowidth: true,
caption: "SQL Code Coverage Objects",
beforeSelectRow: function(rowid, e) {
return false;
},
pager: '#pager2',
rowNum: 10
});
var mydata = sqlcc_objects[codeCoverage];
/*
var mydata = [
{id:"1",invdate:"2007-10-01",name:"test",note:"note",amount:"200.00",tax:"10.00",total:"210.00"},
{id:"2",invdate:"2007-10-02",name:"test2",note:"note2",amount:"300.00",tax:"20.00",total:"320.00"},
{id:"3",invdate:"2007-09-01",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"},
{id:"4",invdate:"2007-10-04",name:"test",note:"note",amount:"200.00",tax:"10.00",total:"210.00"},
{id:"5",invdate:"2007-10-05",name:"test2",note:"note2",amount:"300.00",tax:"20.00",total:"320.00"},
{id:"6",invdate:"2007-09-06",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"},
{id:"7",invdate:"2007-10-04",name:"test",note:"note",amount:"200.00",tax:"10.00",total:"210.00"},
{id:"8",invdate:"2007-10-03",name:"test2",note:"note2",amount:"300.00",tax:"20.00",total:"320.00"},
{id:"9",invdate:"2007-09-01",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"}
];
*/
for(var i=0;i<=mydata.length;i++)
jQuery("#list4").jqGrid('addRowData',i+1,mydata[i]);
$("#list4").setGridParam({sortname:'Name', sortorder: 'asc'}).trigger('reloadGrid');
$("#list4").jqGrid('filterToolbar', {stringResult: true, searchOnEnter: false, defaultSearch : "cn"});
</script>
</body>
</html>