void attachEvent(
string
trigger, mixed
yourEvent)
|
|
attaches an event.
the following triggers can be used: 'onBeforeChange' 'onAfterChange'
the onXXXChange events fire when the wheel is used, a button (up/down) is clicked, cursor up or down is pushed. but they do NOT fire when you use the api methods setValue(), increase() and decrease(). because then you already know what's happening.
the events will be executed in the order they were registered.
if an onBeforeXXX event you've attached returns bool FALSE, it will stop executing any other attached events in that queue, and it will quit. example: if you attach an onBeforeChange event, and your code returns FALSE, the change won't be done at all.
examples: myObj.attachEvent('onBeforeChange', myFunction); then your function myFunction() receives one param, it is a reference to this object (myObj).
myObj.attachEvent('onBeforeChange', "if (true) return false;"); this is an example with code attached that will be evaluated.
Tags:
Parameters:
int fixValue(
mixed
value)
|
|
checks min and max size etc and returns the 'clean' value.
if we don't have a valid number, then this.minValue is returned. if that is not available either, then 0 is returned.
Tags:
Parameters:
redraws the buttons.
if your number field was in an invisible area while draw() was called (for example in a div that had display:none) then you'll need to call this method once your div becomes visible. this is because the browser does not tell us the right measurements if display is set to none.
also other changes like a window resize require this method.
Tags: