Skip to content

Commit 86c9c3e

Browse files
committed
Merge branch 'grid' of github.com:jquery/jquery-ui into grid
2 parents 1dcdeb5 + 53d6f2b commit 86c9c3e

File tree

2 files changed

+111
-9
lines changed

2 files changed

+111
-9
lines changed

grid-type/detection.html

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>Grid: Type</title>
5+
<meta charset=utf-8 />
6+
<link rel="stylesheet" href="../themes/base/jquery.ui.all.css" title="ui-theme" />
7+
<script src="../jquery-1.4.4.js"></script>
8+
<script src="../external/jquery.global.js"></script>
9+
<script src="../external/jquery.global.de-DE.js"></script>
10+
<script src="../external/jquery.global.ja-JP.js"></script>
11+
<script type="text/javascript">
12+
$(function() {
13+
var table = $( "table" );
14+
thead = table.children( "thead" ),
15+
tbody = table.children( "tbody" );
16+
17+
thead.find( "th" ).each(function() {
18+
var index = this.cellIndex,
19+
type = "string";
20+
21+
tbody.children().each( function() {
22+
var cell = $( this.cells[ index ] ).text();
23+
if ( $.global.parseDate( cell ) ) {
24+
type = "date";
25+
} else if ( $.global.parseFloat( cell ) ) {
26+
type = "number"
27+
if ( cell.indexOf( $.global.cultures["default"].numberFormat.currency.symbol ) > -1) {
28+
type = "currency";
29+
}
30+
}
31+
});
32+
33+
$( this ).text( function( index, text ) {
34+
return text + " (" + type + ")";
35+
})
36+
});
37+
});
38+
</script>
39+
<style>
40+
body { font-size:62.5%; }
41+
table {
42+
border-collapse: collapse;
43+
}
44+
th, td {
45+
padding: 0.5em;
46+
border: 1px solid black;
47+
}
48+
</style>
49+
</head>
50+
<body>
51+
52+
<table>
53+
<thead>
54+
<tr>
55+
<th>Year</th>
56+
<th>US Revenue</th>
57+
<th>EU Revenue</th>
58+
<th>JP Revenue</th>
59+
<th>Peak Traffic</th>
60+
</tr>
61+
</thead>
62+
<tbody>
63+
<tr>
64+
<td>2005</td>
65+
<td>$0.00</td>
66+
<td>0,00 €</td>
67+
<td>¥0</td>
68+
<td>12/1/2005</td>
69+
</tr>
70+
<tr>
71+
<td>2006</td>
72+
<td>$0.50</td>
73+
<td>10.000,00 €</td>
74+
<td>¥1,500</td>
75+
<td>5/16/2006</td>
76+
</tr>
77+
<tr>
78+
<td>2007</td>
79+
<td>$10,000.00</td>
80+
<td>0,50 €</td>
81+
<td>-¥115</td>
82+
<td>6/3/2007</td>
83+
</tr>
84+
<tr>
85+
<td>2008</td>
86+
<td>$-10,000.00</td>
87+
<td>0,06 €</td>
88+
<td>¥10,000</td>
89+
<td>12/1/2008</td>
90+
</tr>
91+
<tr>
92+
<td>2009</td>
93+
<td>$-10.00</td>
94+
<td>-10,00 €</td>
95+
<td>-¥150</td>
96+
<td>12/30/2009</td>
97+
</tr>
98+
<tr>
99+
<td>2010</td>
100+
<td>$0.06</td>
101+
<td>-10.000,00 €</td>
102+
<td>¥15</td>
103+
<td>2/28/2010</td>
104+
</tr>
105+
</tbody>
106+
</table>
107+
108+
</body>
109+
</html>

grid-type/type.html

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
1-
<!doctype html>
1+
<!DOCTYPE html>
22
<html>
33
<head>
44
<title>Grid: Type</title>
55
<meta charset=utf-8 />
6-
<link rel="stylesheet" href="../visual.css" />
76
<link rel="stylesheet" href="../themes/base/jquery.ui.all.css" title="ui-theme" />
87
<script src="../jquery-1.4.4.js"></script>
98
<script src="../external/jquery.global.js"></script>
109
<script src="../external/jquery.global.de-DE.js"></script>
1110
<script src="../external/jquery.global.ja-JP.js"></script>
12-
<script src="../ui/jquery.ui.core.js"></script>
13-
<script src="../ui/jquery.ui.widget.js"></script>
14-
<script src="../ui/jquery.ui.datepicker.js"></script>
1511
<script type="text/javascript">
1612
$(function() {
1713
var table = $("table");
@@ -41,10 +37,7 @@
4137
head.data("sort-order", order);
4238
});
4339
thead.children().clone().insertAfter(thead).find("th").each(function() {
44-
var input = $("<input />").appendTo($(this).empty());
45-
if ($(this).data("type") == "date") {
46-
//input.datepicker();
47-
}
40+
$("<input />").appendTo($(this).empty());
4841
});
4942
table.delegate("input", "keyup change", function() {
5043
var head = $(this).parent(),

0 commit comments

Comments
 (0)