Skip to content

Commit

Permalink
Initial prototype for grid markup.
Browse files Browse the repository at this point in the history
  • Loading branch information
rdworth committed Feb 2, 2011
1 parent 9964356 commit cdd2589
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 0 deletions.
3 changes: 3 additions & 0 deletions grid-markup/grid.css
@@ -0,0 +1,3 @@
/*
* grid.css
*/
50 changes: 50 additions & 0 deletions grid-markup/grid.html
@@ -0,0 +1,50 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Grid: Markup</title>
<style>body{font:62.5% Verdana,Arial,sans-serif}</style>
<link rel="stylesheet" href="../themes/base/jquery.ui.all.css">
<link rel="stylesheet" href="grid.css">
<script src="../jquery-1.4.4.js"></script>
<script src="../ui/jquery.ui.core.js"></script>
<script src="../ui/jquery.ui.widget.js"></script>
<script src="grid.js"></script>
<script>
$(function() {
$( "#dataTable1" ).grid();
});
</script>
</head>
<body>

<table id="dataTable1">
<thead>
<tr>
<th>First Name</th>
<th>Last Name</th>
<th>Country</th>
<th>Twitter</th>
<th>GitHub</th>
</tr>
</thead>
<tbody>
<tr>
<td>John</td>
<td>Resig</td>
<td>USA</td>
<td>jeresig</td>
<td>jeresig</td>
</tr>
<tr>
<td>Scott</td>
<td>Jehl</td>
<td>USA</td>
<td>filamentgroup</td>
<td>scottjehl</td>
</tr>
</tbody>
</table>

</body>
</html>
30 changes: 30 additions & 0 deletions grid-markup/grid.js
@@ -0,0 +1,30 @@
/*
* grid.js
*/
(function( $ ) {

$.widget( "ui.grid", {
options: {},
_create: function() {
var uiGrid = ( this.uiDialog = $("<div class='ui-widget ui-grid'></div>") )
.insertBefore( this.element ),

uiGridHead = ( this.uiGridHead = $("<div class='ui-widget-header ui-grid-head'></div>") )
.appendTo( uiGrid ),

uiGridBody = ( this.uiGridBody = $("<div class='ui-widget-content ui-grid-body'></div>") )
.appendTo( uiGrid ),

uiGridBodyTable = ( this.uiGridBodyTable = $("<table></table") )
.appendTo( uiGridBody ),

uiGridHeadTable = this.element
.appendTo( uiGridHead );

uiGridHeadTable.find("tbody")
.appendTo( uiGridBodyTable );

}
});

}( jQuery ));

0 comments on commit cdd2589

Please sign in to comment.