click : null,
dblclick : null,
contextmenu : null,
- menuEvent : 'dblclick', // event that triggers menus - click, dblclick, contextmenu, or none (no menus)
- defaultWidth : -1, // if -1, then use unformatted column width
- scrollBarWidth : 19, // this is the value used in positioning calculations, it does not actually change the width of the scrollbar
- minScrollWidth : 100, // min scroll area width when width of frozen columns exceeds window width
+ menuEvent : null, // event that triggers menus - click, dblclick, contextmenu, or none (no menus)
+ defaultWidth : -1, // if -1, then use unformatted column width
+ scrollBarWidth : 19, // this is the value used in positioning calculations, it does not actually change the width of the scrollbar
+ minScrollWidth : 100, // min scroll area width when width of frozen columns exceeds window width
frozenColumns : 0,
exportWindow : "height=400,width=500,scrollbars=1,menubar=1,resizable=1,location=0,toolbar=0,status=0",
exportStyleList : ['background-color','color','text-align','font-weight','font-size','font-family'],
FilterAllToken : '___ALL___', // select box value to use to indicate ALL
columnSpecs : []
};
- this.colWidths = [];
this.hdrCells=[];
this.headerColCnt=0;
this.headerRowIdx=0; // row in header which gets resizers (no colspan's in this row)
this.direction=Rico.getStyle(this.outerDiv,'direction').toLowerCase(); // ltr or rtl
this.align=this.direction=='rtl' ? ['right','left'] : ['left','right'];
Rico.log('createColumnArray: dir='+this.direction);
+ for (var i=0; i<2; i++) Rico.addClass(this.thead[i].rows[this.headerRowIdx],'rico_ResizeRow');
this.columns = [];
for (var c=0; c < this.headerColCnt; c++) {
Rico.log("createColumnArray: c="+c);
*/
createDivs: function() {
Rico.log("createDivs start");
- this.outerDiv = this.createDiv("outer");
- if (Rico.theme.widget) Rico.addClass(this.outerDiv,Rico.theme.widget);
+ this.outerDiv = this.createDiv("outer");
+ if (Rico.theme.gridContainer) Rico.addClass(this.outerDiv,Rico.theme.gridContainer);
if (this.outerDiv.firstChild && this.outerDiv.firstChild.tagName && this.outerDiv.firstChild.tagName.toUpperCase()=='TABLE') {
this.structTab=this.outerDiv.firstChild;
this.structTabLeft=this.structTab.rows[0].cells[0];
tr1.vAlign='top';
this.structTabLeft=tr1.insertCell(-1);
this.structTabLeft.rowSpan=2;
+ this.structTabLeft.style.padding='0px';
+ this.structTabLeft.style.border='none';
var tr2=this.structTab.insertRow(-1);
tr2.vAlign='top';
this.structTabUR=tr1.insertCell(-1);
+ this.structTabUR.style.padding='0px';
+ this.structTabUR.style.border='none';
this.structTabLR=tr2.insertCell(-1);
+ this.structTabLR.style.padding='0px';
+ this.structTabLR.style.border='none';
this.outerDiv.appendChild(this.structTab);
}
+ Rico.addClass(this.structTab,'ricoLG_StructTab');
//this.structTabLR.style.overflow='hidden';
//if (Rico.isOpera) this.outerDiv.style.overflow="hidden";
this.frozenTabs = this.createDiv("frozenTabs",this.structTabLeft);
return Rico.windowHeight()-divPos.top-2*this.options.scrollBarWidth-15; // allow for scrollbar and some margin
},
- setHorizontalScroll: function() {
- var newLeft=(-this.scrollDiv.scrollLeft)+'px';
- this.hdrTabs[1].style.marginLeft=newLeft;
- },
-
- pluginScroll: function() {
- if (this.scrollPluggedIn) return;
- Rico.eventBind(this.scrollDiv,"scroll",this.scrollEventFunc, false);
- this.scrollPluggedIn=true;
- },
-
- unplugScroll: function() {
- Rico.eventUnbind(this.scrollDiv,"scroll", this.scrollEventFunc , false);
- this.scrollPluggedIn=false;
- },
-
hideMsg: function() {
this.messagePopup.closePopup();
},
}
}
Rico.log('opening columnChooser');
- this.columnChooser.openPopup(1,this.hdrHt);
+ this.columnChooser.openPopup(3,this.hdrHt+3);
for (x=0;x<this.columns.length;x++) {
this.columns[x].ChooserBox.checked=this.columns[x].visible;
this.columns[x].ChooserBox.disabled = !this.columns[x].canHideShow();
SORT_ASC: "ASC",
SORT_DESC: "DESC",
- MINWIDTH: 10,
- DOLLAR: {type:'number', prefix:'$', decPlaces:2, ClassName:'alignright'},
- EURO: {type:'number', prefix:'€', decPlaces:2, ClassName:'alignright'},
- PERCENT: {type:'number', suffix:'%', decPlaces:2, multiplier:100, ClassName:'alignright'},
- QTY: {type:'number', decPlaces:0, ClassName:'alignright'},
- DEFAULT: {type:"showTags"}
+ MINWIDTH: 10
}
* Common code used to initialize the column in both SimpleGrid & LiveGrid
*/
baseInit: function(liveGrid,colIdx,hdrInfo,tabIdx) {
- Rico.log("TableColumnBase.init index="+colIdx+" tabIdx="+tabIdx);
+ Rico.log("TableColumnBase.baseInit index="+colIdx+" tabIdx="+tabIdx);
this.liveGrid = liveGrid;
this.index = colIdx;
this.hideWidth = Rico.isKonqueror || Rico.isWebKit || liveGrid.headerRowCnt>1 ? 5 : 2; // column width used for "hidden" columns. Anything less than 5 causes problems with Konqueror. Best to keep this greater than padding used inside cell.
this.mouseUpHandler = Rico.eventHandle(this,'handleMouseUp');
this.mouseOutHandler = Rico.eventHandle(this,'handleMouseOut');
- this.fieldName = 'col'+this.index;
+ this.format={type:"text"};
var spec = liveGrid.options.columnSpecs[colIdx];
- this.format=Rico.extend( {}, Rico.ColumnConst.DEFAULT);
- switch (typeof spec) {
- case 'object':
- if (typeof spec.format=='string') Rico.extend(this.format, Rico.ColumnConst[spec.format.toUpperCase()]);
- Rico.extend(this.format, spec);
- break;
- case 'string':
- if (spec.slice(0,4)=='spec') spec=spec.slice(4).toUpperCase(); // for backwards compatibility
- if (typeof Rico.ColumnConst[spec]=='object') Rico.extend(this.format, Rico.ColumnConst[spec]);
- break;
- }
+ if (typeof spec == 'object') Rico.extend(this.format, spec);
Rico.addClass(this.dataColDiv, this.colClassName());
this.visible=true;
if (typeof this.format.visible=='boolean') this.visible=this.format.visible;
- Rico.log("TableColumn.init index="+colIdx+" fieldName="+this.fieldName);
this.sortable = typeof this.format.canSort=='boolean' ? this.format.canSort : liveGrid.options.canSortDefault;
this.currentSort = Rico.ColumnConst.UNSORTED;
this.filterable = typeof this.format.canFilter=='boolean' ? this.format.canFilter : liveGrid.options.canFilterDefault;
*/
getDisplayName: function(el) {
var anchors=el.getElementsByTagName("A");
- //Check the existance of A tags
- if (anchors.length > 0)
- return anchors[0].innerHTML;
- else
- return Rico.stripTags(el.innerHTML);
+ var s=anchors.length > 0 ? anchors[0].innerHTML : Rico.stripTags(el.innerHTML);
+ return Rico.trim(s);
},
_clear: function(gridCell) {
clearCell: function(rowIndex) {
var gridCell=this.cell(rowIndex);
this._clear(gridCell,rowIndex);
- if (!this.liveGrid.buffer) return;
- var acceptAttr=this.liveGrid.buffer.options.acceptAttr;
- for (var k=0; k<acceptAttr.length; k++) {
- switch (acceptAttr[k]) {
- case 'style': gridCell.style.cssText=''; break;
- case 'class': gridCell.className=''; break;
- default: gridCell['_'+acceptAttr[k]]=''; break;
- }
- }
+ if (this.liveGrid.buffer && this.liveGrid.buffer.options.acceptStyle) gridCell.style.cssText='';
},
dataTable: function() {
this.origWidth=parseInt(this.colWidth,10);
var p=Rico.positionedOffset(this.hdrCell);
if (this.liveGrid.direction=='rtl') {
- this.edge=p.left+this.liveGrid.options.scrollBarWidth;
+ this.edge=p.left;
switch (this.tabIdx) {
case 0: this.edge+=this.liveGrid.innerDiv.offsetWidth; break;
case 1: this.edge-=this.liveGrid.scrollDiv.scrollLeft; break;