zk
Class Scrollbar

java.lang.Object
  extended by zk.Scrollbar

public class Scrollbar
extends java.lang.Object

Tricky. ie6/ie7 strange behavior, will generate horizontal scrollbar, minus one to avoid it! var total = bdtable.parentNode[useOffset ? 'offsetWidth' : 'clientWidth'] - (zk.ie < 8 ? 1 : 0), extSum = total - width; var count = total, visj = -1; if (this._nspan < 0) { //span to all columns for (var i = hdfaker.cells.length - (fakerflex ? 1 : 0); i--;) { if (!zk(hdfaker.cells[i]).isVisible()) continue; wds[i] = wd = extSum <= 0 ? wds[i] : (((wds[i] * total / width) + 0.5) | 0); var rwd = zk(bdfaker.cells[i]).revisedWidth(wd), stylew = jq.px0(rwd); count -= wd; visj = i; if (bdfaker.cells[i].style.width == stylew) continue; bdfaker.cells[i].style.width = stylew; hdfaker.cells[i].style.width = stylew; if (ftfaker) ftfaker.cells[i].style.width = stylew; var cpwd = zk(head.cells[i]).revisedWidth(rwd); head.cells[i].style.width = jq.px0(cpwd); var cell = head.cells[i].firstChild; cell.style.width = zk(cell).revisedWidth(cpwd) + "px"; } //compensate calc error if (extSum > 0 && count != 0 && visj >= 0) { wd = wds[visj] + count; var rwd = zk(bdfaker.cells[visj]).revisedWidth(wd), stylew = jq.px0(rwd); bdfaker.cells[visj].style.width = stylew; hdfaker.cells[visj].style.width = stylew; if (ftfaker) ftfaker.cells[visj].style.width = stylew; var cpwd = zk(head.cells[visj]).revisedWidth(rwd); head.cells[visj].style.width = jq.px0(cpwd); var cell = head.cells[visj].firstChild; cell.style.width = zk(cell).revisedWidth(cpwd) + "px"; } } else { //feature#3184415: span to a specific column // start of ZK-1043: can remove after FF 13 var ff = zk.gecko, ff_10_12 = ff > 9 && ff < 13, ebody = this.ebody, h; if (ff_10_12) { if (ebody) h = ebody.style.height; if (h) ebody.style.height = ''; } // end of ZK-1043 visj = this._nspan - 1; for (var i = hdfaker.cells.length - (fakerflex ? 1 : 0); i--;) { if (!zk(hdfaker.cells[i]).isVisible()) continue; wd = visj == i && extSum > 0 ? (wds[visj] + extSum) : wds[i]; var rwd = zk(bdfaker.cells[i]).revisedWidth(wd), stylew = jq.px0(rwd); if (bdfaker.cells[i].style.width == stylew) continue; bdfaker.cells[i].style.width = stylew; hdfaker.cells[i].style.width = stylew; if (ftfaker) ftfaker.cells[i].style.width = stylew; var cpwd = zk(head.cells[i]).revisedWidth(rwd); head.cells[i].style.width = jq.px0(cpwd); var cell = head.cells[i].firstChild; cell.style.width = zk(cell).revisedWidth(cpwd) + "px"; } // start of ZK-1043: can remove after FF 13 if (ff_10_12 && h) ebody.style.height = h; // end of ZK-1043 } //bug 3188738: Opera only. Grid/Listbox/Tree span="x" not working if (zk.opera) zk(this.$n()).redoCSS(); }, _adjHeadWd: function () { var hdfaker = this.ehdfaker, bdfaker = this.ebdfaker, ftfaker = this.eftfaker, fakerflex = this.head ? this.head.$n('hdfakerflex') : null; if (!hdfaker || !bdfaker || !hdfaker.cells.length || !bdfaker.cells.length || !zk(hdfaker).isRealVisible() || !this.getBodyWidgetIterator().hasNext()) return; var hdtable = this.ehead.firstChild, head = this.head.$n(); if (!head) return; // Bug #1886788 the size of these table must be specified a fixed size. var bdtable = this.ebody.firstChild; var total = Math.max(hdtable.offsetWidth, bdtable.offsetWidth), tblwd = Math.min(bdtable.parentNode.clientWidth, bdtable.offsetWidth); if (total == this.ebody.offsetWidth && this.ebody.offsetWidth > tblwd && this.ebody.offsetWidth - tblwd < 20) total = tblwd; this._calcMinWds(); //i.e. this._minWd = _calcMinWd(this); var xwds = this._minWd, wds = xwds.wds, width = xwds.width; for (var i = bdfaker.cells.length - (fakerflex ? 1 : 0), hwgt = this.head.lastChild; i--; hwgt = hwgt.previousSibling) { // sizedByContent shall not override column width if (!zk(hdfaker.cells[i]).isVisible() || hwgt._width) continue; var wd = wds[i], rwd = zk(bdfaker.cells[i]).revisedWidth(wd), wdpx = rwd + "px"; hdfaker.cells[i].style.width = bdfaker.cells[i].style.width = wdpx; if (ftfaker) ftfaker.cells[i].style.width = wdpx; var cpwd = zk(head.cells[i]).revisedWidth(rwd); head.cells[i].style.width = cpwd + "px"; var cell = head.cells[i].firstChild; cell.style.width = zk(cell).revisedWidth(cpwd) + "px"; } // in some case, the total width of this table may be changed. if (total != hdtable.offsetWidth) { total = hdtable.offsetWidth; tblwd = Math.min(this.ebody.clientWidth, bdtable.offsetWidth); if (total == this.ebody.offsetWidth && this.ebody.offsetWidth > tblwd && this.ebody.offsetWidth - tblwd < 20) total = tblwd; } _adjMinWd(this); } }); /** The extra Scrollbar for the MeshWidget. It is designed to be overriden

Since:
6.5.0

Method Summary
static int getScrollPosV(Widget wgt)
          Return the vertical scroll position of the given DOM elements.
static void init(Widget wgt)
          Initialize the scrollbar.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

init

public static void init(Widget wgt)
Initialize the scrollbar.

Parameters:
wgt - a widget

getScrollPosV

public static int getScrollPosV(Widget wgt)
Return the vertical scroll position of the given DOM elements.

Parameters:
wgt - the widget
Returns:
int


Copyright © 2005-2011 Potix Corporation. All Rights Reserved. SourceForge.net Logo