Class Index | File Index

Classes


Class MochiKit.Widget.ProgressBar


Extends MochiKit.Widget.
The progress bar widget class. Used to provide a dynamic progress meter, using two <div> HTML elements. The progress bar also provides a completion time estimation that is displayed in the bar. Whenever the range is modified, the time estimation is reset.
Defined in: Widget.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Creates a new progress bar widget.
Fields borrowed from class MochiKit.Widget:
_id, Classes
Method Summary
Method Attributes Method Name and Description
 
setAttrs(attrs)
Updates the widget or HTML DOM node attributes.
 
setRatio(ratio, text)
Updates the progress bar completion ratio.
 
setText(text)
Updates the progress bar text.
 
setValue(value, text)
Updates the progress bar completion value.
Methods borrowed from class MochiKit.Widget:
_animQueueId, _createWidgetTreeElem, _eventHandler, _widgetMixin, addAll, addChildNode, addClass, animate, blurAll, createWidget, createWidgetTree, destroy, destroyWidget, emitSignal, getChildNodes, hasClass, hide, isFormField, isHidden, isWidget, removeAll, removeChildNode, removeClass, setStyle, show, toggleClass
Class Detail
MochiKit.Widget.ProgressBar(attrs)
Creates a new progress bar widget.
Parameters:
{Object} attrs
the widget and node attributes
{Number} attrs.min Optional
the minimum range value, defaults to 0
{Number} attrs.max Optional
the maximum range value, defaults to 100
Returns:
{Widget} the widget DOM node
Method Detail
setAttrs(attrs)
Updates the widget or HTML DOM node attributes.
Parameters:
{Object} attrs
the widget and node attributes to set
{Number} attrs.min Optional
the minimum range value, defaults to 0
{Number} attrs.max Optional
the maximum range value, defaults to 100

setRatio(ratio, text)
Updates the progress bar completion ratio. The ratio value should be a floating-point number between 0.0 and 1.0. The ratio is used both for updating the progress meter and for calculating an approximate remaining time. Any previous progress bar text will be replaced by this method.
Parameters:
{Number} ratio
the new progress ratio, a floating-point number between 0.0 and 1.0
{String} text Optional
the additional information text

setText(text)
Updates the progress bar text.
Parameters:
{String} text
the new progress bar text

setValue(value, text)
Updates the progress bar completion value. The value should be within the range previuosly established by the "min" and "max" attributes and is used to calculate a completion ratio. The ratio is then used both for updating the progress meter and for calculating an approximate remaining time. Any previous progress bar text will be replaced by this method.
Parameters:
{Number} value
the new progress value
{String} text Optional
the additional information text

Documentation generated by JsDoc Toolkit 2.0.2 on Sun May 24 2009 13:14:16 GMT+0200 (CEST)