Rico.setDebugArea(tableId+"_debugmsgs"); // if used, this should be a textarea
Rico.extend(this.options, {
- visibleRows : -1, // -1 or 'window'=size grid to client window; -2 or 'data'=size grid to min(window,data); -3 or 'body'=size so body does not have a scrollbar; -4 or 'parent'=size to parent element (e.g. if grid is inside a div)
+ visibleRows : -3, // -1 or 'window'=size grid to client window; -2 or 'data'=size grid to min(window,data); -3 or 'body'=size so body does not have a scrollbar; -4 or 'parent'=size to parent element (e.g. if grid is inside a div)
frozenColumns : 0,
offset : 0, // first row to be displayed
prefetchBuffer : true, // load table on page load?
}
break;
default:
- this.sizeTo='window';
- this.options.visibleRows=-1;
+ this.sizeTo='body';
+ this.options.visibleRows=-3;
break;
}
this.highlightEnabled=this.options.highlightSection>0;
}
this.createDivs();
- this.scrollTabs = this.createDiv("scrollTabs",this.innerDiv);
+ this.scrollContainer = this.createDiv("scrollContainer",this.structTabLR);
+ this.scrollContainer.appendChild(this.scrollDiv); // move scrollDiv
+ this.scrollTab = this.createDiv("scrollTab",this.scrollContainer);
this.shadowDiv = this.createDiv("shadow",this.scrollDiv);
this.shadowDiv.style.direction='ltr'; // avoid FF bug
this.scrollDiv.style.display="none";
case 'menuCell':
case 'cursorCell':
for (i=0; i<2; i++) {
- this.highlightDiv[i] = this.createDiv("highlight",i==0 ? this.frozenTabs : this.scrollTabs);
+ this.highlightDiv[i] = this.createDiv("highlight",i==0 ? this.frozenTabs : this.scrollTab);
this.highlightDiv[i].style.display="none";
this.highlightDiv[i].id+=i;
}
break;
case 'selection':
// create one div for each side of the rectangle
- var parentDiv=this.options.highlightSection==1 ? this.frozenTabs : this.scrollTabs;
+ var parentDiv=this.options.highlightSection==1 ? this.frozenTabs : this.scrollTab;
for (i=0; i<4; i++) {
this.highlightDiv[i] = this.createDiv("highlight",parentDiv);
this.highlightDiv[i].style.display="none";
}
// create new tables
- for (i=0; i<2; i++) {
+ for (i=0; i<3; i++) {
this.tabs[i] = document.createElement("table");
this.tabs[i].className = 'ricoLG_table';
this.tabs[i].border=0;
this.tabs[i].cellPadding=0;
this.tabs[i].cellSpacing=0;
this.tabs[i].id = this.tableId+"_tab"+i;
+ }
+ // set headings
+ for (i=0; i<2; i++) {
this.thead[i]=this.tabs[i].createTHead();
- this.thead[i].className='ricoLG_top';
+ Rico.addClass(this.tabs[i],'ricoLG_top');
+ //this.thead[i].className='ricoLG_top';
if (Rico.theme.gridheader) Rico.addClass(this.thead[i],Rico.theme.gridheader);
- this.tbody[i]=Rico.getTBody(this.tabs[i]);
+ }
+ // set bodies
+ for (i=0; i<2; i++) {
+ this.tbody[i]=Rico.getTBody(this.tabs[i==0?0:2]);
this.tbody[i].className='ricoLG_bottom';
if (Rico.theme.gridcontent) Rico.addClass(this.tbody[i],Rico.theme.gridcontent);
this.tbody[i].insertRow(-1);
}
this.frozenTabs.appendChild(this.tabs[0]);
- this.scrollTabs.appendChild(this.tabs[1]);
+ this.innerDiv.appendChild(this.tabs[1]);
+ this.scrollTab.appendChild(this.tabs[2]);
if (insertloc) insertloc.parentNode.insertBefore(this.outerDiv,insertloc);
if (hdrSrc) {
this.headerColCnt = this.getColumnInfo(hdrSrc);
var totRowHt=this.columns[firstVisible].dataColDiv.offsetHeight;
this.rowHeight = Math.round(totRowHt/this.pageSize);
var scrHt=this.dataHt;
- if (this.scrWi>0 || Rico.isIE || Rico.isWebKit)
+ if (this.scrTabWi0 == this.scrTabWi) {
+ // no scrolling columns - horizontal scroll bar not needed
+ this.innerDiv.style.height=(this.hdrHt+1)+'px';
+ this.scrollDiv.style.overflowX='hidden';
+ } else {
+ this.scrollDiv.style.overflowX='scroll';
scrHt+=this.options.scrollBarWidth;
+ }
this.scrollDiv.style.height=scrHt+'px';
- this.innerDiv.style.width=(this.scrWi-this.options.scrollBarWidth+1)+'px';
- this.resizeDiv.style.height=this.frozenTabs.style.height=this.innerDiv.style.height=(this.hdrHt+this.dataHt+1)+'px';
+ this.innerDiv.style.width=(this.scrWi)+'px';
+ this.scrollTab.style.width=(this.scrWi-this.options.scrollBarWidth)+'px';
+ //this.resizeDiv.style.height=this.frozenTabs.style.height=this.innerDiv.style.height=(this.hdrHt+this.dataHt+1)+'px';
+ this.resizeDiv.style.height=(this.hdrHt+this.dataHt+1)+'px';
Rico.log('sizeDivs scrHt='+scrHt+' innerHt='+this.innerDiv.style.height+' rowHt='+this.rowHeight+' pageSize='+this.pageSize);
var pad=(this.scrWi-this.scrTabWi < this.options.scrollBarWidth) ? 2 : 0;
this.shadowDiv.style.width=(this.scrTabWi+pad)+'px';
},
setHorizontalScroll: function() {
- var scrleft=this.scrollDiv.scrollLeft;
- this.scrollTabs.style.left=(-scrleft)+'px';
+ var newLeft=(-this.scrollDiv.scrollLeft)+'px';
+ this.tabs[1].style.marginLeft=newLeft;
+ this.tabs[2].style.marginLeft=newLeft;
},
remainingHt: function() {
if (!Rico.isIE && window.frameElement && window.frameElement.scrolling=='yes' && this.sizeTo!='parent') margin+=this.options.scrollBarWidth;
switch (this.sizeTo) {
case 'window':
- case 'data':
var divTop=Rico.cumulativeOffset(this.outerDiv).top;
tabHt=Math.max(this.tabs[0].offsetHeight,this.tabs[1].offsetHeight);
Rico.log("remainingHt, winHt="+winHt+' tabHt='+tabHt+' gridY='+divTop);
if (Rico.isIE) Rico.show(this.outerDiv);
Rico.log("remainingHt, parentHt="+parentHt+' gridY='+offset+' winHt='+winHt+' tabHt='+tabHt);
return parentHt - tabHt - offset - this.options.scrollBarWidth;
+ case 'data':
case 'body':
- //Rico.log("remainingHt, document.height="+document.height);
- //Rico.log("remainingHt, body.offsetHeight="+document.body.offsetHeight);
- //Rico.log("remainingHt, body.scrollHeight="+document.body.scrollHeight);
- //Rico.log("remainingHt, documentElement.scrollHeight="+document.documentElement.scrollHeight);
var bodyHt=Rico.isIE ? document.body.scrollHeight : document.body.offsetHeight;
+ //alert("remainingHt\n document.height="+document.height+"\n body.offsetHeight="+document.body.offsetHeight+"\n body.scrollHeight="+document.body.scrollHeight+"\n documentElement.scrollHeight="+document.documentElement.scrollHeight);
var remHt=winHt-bodyHt-margin;
if (!Rico.isWebKit) remHt-=this.options.scrollBarWidth;
Rico.log("remainingHt, winHt="+winHt+' pageHt='+bodyHt+' remHt='+remHt);
return this._format(v);
},
+exportBuffer: function(bufRow) {
+ return this._export(this.buffer.getValue(bufRow,this.index));
+},
+
displayValue: function(windowRow) {
var bufval=this.getValue(windowRow);
if (bufval==null) {