Skip to content

Commit 6da664a

Browse files
committed
Added much better support for different themes. Made rows hoverable
1 parent c08cf52 commit 6da664a

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

grid-markup/grid.css

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ Presentational
3333
border-right-width: 0;
3434
}
3535
.ui-grid .ui-grid-body {
36-
border-top-width: 0;
37-
border-bottom-width: 0;
36+
border-width: 0;
3837
}
3938
.ui-grid .ui-grid-body tr {
4039
height: 2em;
@@ -45,6 +44,7 @@ Presentational
4544
.ui-grid .ui-grid-body td {
4645
border-top-width: 0;
4746
border-right-width: 0;
47+
background: none;
4848
}
4949
.ui-grid th, .ui-grid td {
5050
padding: 0.2em 0.4em;
@@ -53,15 +53,18 @@ Presentational
5353
border-top-width: 0;
5454
}
5555

56+
.ui-grid .ui-grid-body {
57+
background-image: none;
58+
}
5659
.ui-grid tr.ui-state-default,
5760
.ui-grid td.ui-state-default {
58-
background: none;
61+
background-image: none;
5962
}
6063

6164
.ui-grid-resizable .ui-resizable-se {
6265
width: 17px;
6366
height: 17px;
64-
bottom: -5px;
67+
bottom: -4px;
6568
right: -2px;
6669
}
6770
.ui-grid-resizable .ui-resizable-s {

grid-markup/grid.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ $.widget( "ui.grid", {
2020
.insertBefore( this.element ),
2121

2222
// Add grid head and grid body
23-
uiGridHead = ( this.uiGridHead = $("<div class='ui-widget-header ui-grid-head'></div>") )
23+
uiGridHead = ( this.uiGridHead = $("<div class='ui-grid-head'></div>") )
2424
.appendTo( uiGrid ),
2525
uiGridBody = ( this.uiGridBody = $("<div class='ui-widget-content ui-grid-body'></div>") )
2626
.appendTo( uiGrid ),
2727
uiGridFoot = ( this.uiGridFoot = $("<div class='ui-widget-header ui-grid-foot'></div>") )
2828
.appendTo( uiGrid ),
2929

3030
// New table in grid head for column headers
31-
uiGridHeadTable = ( this.uiGridHeadTable = $("<table class='ui-grid-head-table'></table>") )
31+
uiGridHeadTable = ( this.uiGridHeadTable = $("<table class='ui-widget-content ui-grid-head-table'></table>") )
3232
.appendTo( uiGridHead );
3333

3434
// Existing table in grid body for the body table
@@ -37,7 +37,7 @@ $.widget( "ui.grid", {
3737
.appendTo( uiGridBody );
3838

3939
// Move table CAPTION to grid head
40-
uiGridBodyTable.find( "caption" )
40+
uiGridBodyTable.find( "caption" ).addClass( "ui-widget-header" )
4141
.prependTo( uiGridHeadTable );
4242

4343
// Create COLGROUP and COLs if missing
@@ -72,7 +72,7 @@ $.widget( "ui.grid", {
7272
this._hoverable( uiGridHeadTable.find("th").addClass("ui-state-default") );
7373

7474
// Give body rows a clickable state
75-
uiGridBodyTable.find( "tr" ).addClass( "ui-state-default" );
75+
this._hoverable( uiGridBodyTable.find( "tr" ).addClass( "ui-state-default" ) );
7676

7777
// Give body cells a clickable state
7878
uiGridBodyTable.find( "td" ).addClass( "ui-state-default" );

0 commit comments

Comments
 (0)