Debian Codegraph @

dojox/grid/tests/enhanced/test_enhanced_grid_selector.html

raw symbols SCIP
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
2 "http://www.w3.org/TR/html4/loose.dtd">
3 <html>
4 <head>
5 <title>Test Selector plugin of dojox.grid.EnhancedGrid</title>
6 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta>
7 <link rel=stylesheet href="support/common.css"/>
8 <style type="text/css">
9 body {
10 font-size: 0.9em;
11 font-family: Geneva, Arial, Helvetica, sans-serif;
12 padding: 0.5em;
13 }
14 .title {
15 text-align:center;
16 margin:1em;
17 }
18 #grid{
19 width: 100em;
20 height: 40em;
21 }
22 .selectReport {
23 margin: 10px;
24 display: inline-block;
25 }
26 /*Sample - overwrite default cell style
27 .claro .dojoxGridCell{
28 border-color: transparent #D5CDB5 #D5CDB5 transparent !important;
29 }
30 .dj_ie6 .claro .dojoxGridCell{
31 border: 1px solid #F1F1F1 !important;
32 }*/
33 </style>
34 <script type="text/javascript" src="../../../../dojo/dojo.js" data-dojo-config="isDebug:true, parseOnLoad: true"></script>
35 <script type="text/javascript" src="../../../../dijit/tests/_testCommon.js"></script>
36 <script type="text/javascript">
37 dojo.require("dojo.parser");
38 dojo.require("dojo.data.ItemFileWriteStore");
39 dojo.require("dojox.grid.EnhancedGrid");
40 dojo.require("dojox.grid.enhanced.plugins.Selector");
41 dojo.require("dojox.grid.enhanced.plugins.IndirectSelection");
42
43 var layout = [{
44 cells: [
45 { field: "id", name:"Identity", datatype:"number", width: 4, editable: false},
46 { field: "Genre", name:"Genre", datatype:"string", width: 10},
47 { field: "Artist", name:"Artist", datatype:"string", width: 10},
48 { field: "Year", name:"Year", datatype:"string", width: 2.5},
49 { field: "Album", name:"Album", datatype:"string", width: 10},
50 { field: "Name", name:"Name", datatype:"string", width: 8},
51 { field: "Length", name:"Length", datatype:"string", width: 4},
52 { field: "Track", name:"Track", datatype:"number", width: 3},
53 { field: "Composer", name:"Composer", datatype:"string", width: 12},
54 { field: "Download Date", name:"Download Date", datatype:"date", width: 12},
55 { field: "Last Played", name:"Last Played", datatype:"time", width: 6},
56 { field: "Heard", name: "Checked", datatype:"boolean", width: 6}
57 ]
58 }];
59 var plugins = {
60 selector: {
61 //col: false,
62 //row: false,
63 //cell: false
64 }
65 }
66 dojo.addOnLoad(function(){
67 var grid = dijit.byId("grid");
68 func = function(type, start, end, selected){
69 fill("col", selected["col"]);
70 fill("row", selected["row"]);
71 fill("cell", selected["cell"]);
72 },
73 fill = function(type, selected){
74 var getString;
75 var cells = grid.layout.cells;
76 switch(type){
77 case "col":
78 getString = function(item){
79 return "Column " + item.col + ": " + dojo.toJson(item.except);
80 }
81 break;
82 case "row":
83 getString = function(item){
84 return "Row " + item.row + ": " + dojo.toJson(item.except);
85 }
86 break;
87 case "cell":
88 getString = function(item){
89 return "Cell " + item.row + " , " + item.col;
90 }
91 }
92 dojo.attr(dojo.byId(type + "s"), "value", dojo.map(selected, function(item){
93 return getString(item);
94 }).join('\n'));
95 dojo.attr(dojo.byId(type + "Cnt"), "value", selected.length);
96 };
97 dojo.connect(grid, "onEndSelect", func);
98 dojo.connect(grid, "onEndDeselect", func);
99 });
100 </script>
101 <script type="text/javascript" src="support/test_write_store_music.js"></script>
102 </head>
103 <body class="claro">
104 <h1 class="title" tabindex="0"
105 onfocus="console.log('focus a'),this.style.color='red';"
106 onblur="console.log('blur a'),this.style.color='black';">
107 dojox.grid.EnhancedGrid - Selector</h1>
108 <div id="gridContainer">
109 <div id="grid" dojoType="dojox.grid.EnhancedGrid" store="test_store[0]" structure="layout" plugins="plugins"
110 rowSelector="20px"
111 ></div>
112 </div><br/>
113 <div>
114 <div class="selectReport">
115 <h2>Selected Cells:&nbsp;&nbsp;&nbsp;
116 Count: <input type="text" id="cellCnt" value="0"/>
117 </h2>
118 <textarea id="cells" rows="10" cols="40"></textarea>
119 </div>
120 <div class="selectReport">
121 <h2>Selected Columns:&nbsp;&nbsp;&nbsp;
122 Count: <input type="text" id="colCnt" value="0"/>
123 </h2>
124 <textarea id="cols" rows="10" cols="40"></textarea>
125 </div>
126 <div class="selectReport">
127 <h2>Selected Rows:&nbsp;&nbsp;&nbsp;
128 Count: <input type="text" id="rowCnt" value="0"/>
129 </h2>
130 <textarea id="rows" rows="10" cols="40"></textarea>
131 </div>
132 </div>
133 <p style="float: left;"><strong>Note:</strong> To see the tundra theme, just append <b style="color:blue;">?theme=tundra</b> to the URL.</p>
134 </body>
135 </html>