Author: dmorozov
Date: 2007-07-07 14:25:58 -0400 (Sat, 07 Jul 2007)
New Revision: 1535
Modified:
branches/3.0.2/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/GridBody.js
branches/3.0.2/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/GridHeader.js
branches/3.0.2/sandbox/scrollable-grid/src/main/resources/org/richfaces/renderkit/html/css/grid.xcss
branches/3.0.2/sandbox/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid-header-cell.jspx
Log:
Make header autosizable by content
Modified:
branches/3.0.2/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/GridBody.js
===================================================================
---
branches/3.0.2/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/GridBody.js 2007-07-07
15:44:09 UTC (rev 1534)
+++
branches/3.0.2/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/GridBody.js 2007-07-07
18:25:58 UTC (rev 1535)
@@ -612,7 +612,7 @@
setTimeout(function () {
this.rearrangeRows(options, true, true);
this.container.show();
- this.splash.hide();
+ if(this.splash) this.splash.hide();
this.updateStarted = false;
}.bind(this), 10);
Modified:
branches/3.0.2/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/GridHeader.js
===================================================================
---
branches/3.0.2/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/GridHeader.js 2007-07-07
15:44:09 UTC (rev 1534)
+++
branches/3.0.2/sandbox/scrollable-grid/src/main/javascript/ClientUI/controls/grid/GridHeader.js 2007-07-07
18:25:58 UTC (rev 1535)
@@ -171,9 +171,11 @@
// sort icons
columns[j].sortDesc = details[1];
columns[j].sortAsc = details[2];
+ columns[j].sortSpace = details[3];
if(ClientUILib.isIE && columns[j].sortDesc) {
Element.setStyle(columns[j].sortDesc, {left: "-10px"});
Element.setStyle(columns[j].sortAsc, {left: "-10px"});
+ Element.setStyle(columns[j].sortSpace, {left: "-10px"});
}
j++;
}
@@ -222,9 +224,11 @@
// sort icons
columns[j].sortDesc = details[1];
columns[j].sortAsc = details[2];
+ columns[j].sortSpace = details[3];
if(ClientUILib.isIE && columns[j].sortDesc) {
Element.setStyle(columns[j].sortDesc, {left: "-10px"});
Element.setStyle(columns[j].sortAsc, {left: "-10px"});
+ Element.setStyle(columns[j].sortSpace, {left: "-10px"});
}
}
j++;
@@ -252,6 +256,7 @@
details[0] = document.getElementById(clientId + ":hsep_" + column);
details[1] = document.getElementById(clientId + ":hsortd_" + column);
details[2] = document.getElementById(clientId + ":hsorta_" + column);
+ details[3] = document.getElementById(clientId + ":hsort_" + column);
return details;
},
agjustSeparators: function() {
@@ -417,9 +422,11 @@
if(i != index) {
Element.setStyle(h.sortDesc, {display: 'none'});
Element.setStyle(h.sortAsc, {display: 'none'});
+ Element.setStyle(h.sortSpace, {display: 'block'});
} else{
Element.setStyle(h.sortDesc, {display: (dir == 'desc' ? 'block' :
'none')});
Element.setStyle(h.sortAsc, {display: (dir == 'asc' ? 'block' :
'none')});
+ Element.setStyle(h.sortSpace, {display: 'none'});
}
}
}
Modified:
branches/3.0.2/sandbox/scrollable-grid/src/main/resources/org/richfaces/renderkit/html/css/grid.xcss
===================================================================
---
branches/3.0.2/sandbox/scrollable-grid/src/main/resources/org/richfaces/renderkit/html/css/grid.xcss 2007-07-07
15:44:09 UTC (rev 1534)
+++
branches/3.0.2/sandbox/scrollable-grid/src/main/resources/org/richfaces/renderkit/html/css/grid.xcss 2007-07-07
18:25:58 UTC (rev 1535)
@@ -64,7 +64,6 @@
*/
.ClientUI_Grid_HR {
background-color: #ebeadb;
- height: 22px;
z-index:2;
}
@@ -85,26 +84,29 @@
white-space: nowrap;
border-bottom: 1px solid #cbc7b8;
border-right: 1px solid #ebeadb;
- height:30px !important;
}
+.ClientUI_Grid_HC sort-cell {
+ background-position: right;
+ background-repeat: no-repeat;
+ display: block;
+ width: 16px !important;;
+ position: relative;
+}
+
.ClientUI_Grid_HC .sort-asc {
-/* background-image: url(sort_asc.gif);*/
background-position: right;
background-repeat: no-repeat;
display: none;
- height: 14px;
- width: 16px;
+ width: 16px !important;;
position: relative;
}
.ClientUI_Grid_HC .sort-desc {
-/* background-image: url(sort_desc.gif);*/
background-position: right;
background-repeat: no-repeat;
display: none;
- height: 14px;
- width: 16px;
+ width: 16px !important;;
position: relative;
}
@@ -136,7 +138,7 @@
/**
* Header cell body
*/
-.ClientUI_Grid_HCBody1 {
+.ClientUI_Grid_HCBody {
cursor: default;
padding: 0px 0px;
white-space: nowrap;
@@ -144,15 +146,7 @@
display: block;
overflow: hidden;
width: 100%;
-}
-.ClientUI_Grid_HCBody {
- cursor: default;
font: normal 8pt arial;
- padding: 3px 5px;
- white-space: nowrap;
- position: relative;
- display: block;
- overflow: hidden;
}
.ClientUI_Grid_HCBody span {
font: normal 8pt arial;
Modified:
branches/3.0.2/sandbox/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid-header-cell.jspx
===================================================================
---
branches/3.0.2/sandbox/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid-header-cell.jspx 2007-07-07
15:44:09 UTC (rev 1534)
+++
branches/3.0.2/sandbox/scrollable-grid/src/main/templates/org/richfaces/scrollable-grid-header-cell.jspx 2007-07-07
18:25:58 UTC (rev 1535)
@@ -13,25 +13,24 @@
<td class="ClientUI_Grid_HC Idg-header-cell
#{component.attributes['headerClass']}"
id="#{client_id}:hc_#{cell_index}" columnIndex="#{cell_index}"
sortable="#{component.attributes['sortable']}">
- <span id="#{client_id}:hcc_#{cell_index}"
class="ClientUI_Grid_HCBody1">
- <span id="#{clientId}:hcb_#{cell_index}"
- class="ClientUI_Grid_HCBody">
- <table width="100%" cellspacing="0" cellpadding="0"
border="0" align="center">
- <tbody>
- <tr>
- <td width="100%">
- <span style="width: 100%;">
- <vcp:body/>
- </span>
- </td>
- <td>
- <span id="#{client_id}:hsortd_#{cell_index}"
class="sort-desc" />
- <span id="#{client_id}:hsorta_#{cell_index}"
class="sort-asc" />
- </td>
- </tr>
- </tbody>
- </table>
- </span>
+ <span id="#{clientId}:hcb_#{cell_index}"
+ class="ClientUI_Grid_HCBody">
+ <table width="100%" cellspacing="0" cellpadding="0"
border="0" align="center">
+ <tbody>
+ <tr>
+ <td width="100%">
+ <span style="width: 100%;">
+ <vcp:body/>
+ </span>
+ </td>
+ <td>
+ <div id="#{client_id}:hsort_#{cell_index}"
class="sort-cell"> </div>
+ <span id="#{client_id}:hsortd_#{cell_index}"
class="sort-desc" />
+ <span id="#{client_id}:hsorta_#{cell_index}"
class="sort-asc" />
+ </td>
+ </tr>
+ </tbody>
+ </table>
</span>
<jsp:scriptlet>