Class RaxanElement

Description

Raxan Element Class

This class is used to traverse and manipulate a set of matched DOM elements

  • property-read: RaxanWebPage $page: Reference to Raxan Web Page
  • property: RaxanClientExtension $client: Returns an instance of the CLX for the matched selectors
  • property: int $length: Returns the number of matched elements
  • method: RaxanElment empty(): Removes all children of the matched elements
  • method: RaxanElment clone(): Clone matched elements and return clones

Located in /raxan.element.php (line 21)

RaxanBase
   |
   --RaxanElement
Direct descendents
Class Description
RaxanUIWidget Raxan User Interface Widget Class
Variable Summary
static mixed $callMethods
mixed $doc
mixed $elms
mixed $_context
mixed $_invalidInp
mixed $_length
mixed $_rootElm
mixed $_selector
mixed $_stack
mixed $_storeName
mixed $_validInp
Method Summary
static void addMethod ( $name, [ $callback = null])
RaxanElement __construct (mixed $css, [DOMNode $context = null])
RaxanElement add ( $selector)
RaxanElement after ( $content)
string alphanumericVal ()
RaxanElement append ( $content)
RaxanElement appendTo ( $selector)
RaxanElement appendView ( $view, [ $selector = null], [ $data = null])
RaxanElement attr ( $name, [ $val = null])
RaxanElement autoId ([ $idPrefix = null])
RaxanElement before ( $content)
RaxanElement bind (string $type, [mixed $data = null], [mixed $fn = null])
void checkValidity ([boolean $markInvalid = false], [string $cssClass = null], [mixed $callback = null])
RaxanElement children ([ $selector = null])
void clearNode ( $n)
RaxanElement click (mixed $fn, [strubg $serialize = null])
RaxanElement cloneNodes ([ $deep = null])
RaxanElement css ( $name, [ $val = null])
Mixed &data ( $name, [ $value = null])
string dateVal ([ $format = null])
RaxanElement delegate (string $selector, string $type, [mixed $data = null], [mixed $fn = null])
RaxanElement draggable ([array $opt = null])
RaxanElement droppable ([ $opt = null], array $opt.)
string emailVal ()
RaxanElement end ([ $all = false])
RaxanElement eq ( $index)
RaxanElement expose ([mixed $opt = null])
RaxanElement fadeIn ([mixed $speed = null])
RaxanElement fadeOut ([mixed $speed = null])
RaxanElement filter (string $selector, [boolean $_invert = false])
RaxanElement find ( $selector, [ $returnArray = false])
RaxanElement findByXPath ( $xpath, [ $returnArray = false])
RaxanElement floatVal ([ $v = null])
mixed get ([ $index = null])
Boolean hasClass ( $cls)
RaxanElement height ([ $h = null])
RaxanElement html ([ $html = null])
mixed inputValues ([array $data = null])
void insert ( $content,  $pos, [ $retNodes = false])
RaxanElement insertAfter ( $selector)
RaxanElement insertBefore ( $selector)
RaxanElement intVal ([ $v = null])
array invalidInputs ()
Boolean is ( $selector)
void isHTML ( $str)
RaxanElement map ( $fn)
String matchSelector ([ $autoId = false], [ $idPrefix = null])
string matchVal ([string $pattern = '/[a-zA-Z0-9-.]/'])
void modifyClass ( $classes,  $mode)
RaxanElement next ([ $selector = null])
RaxanElement nextAll ([ $selector = null])
void node ([ $index = null])
RaxanElement not ( $selector)
string outerHtml ()
RaxanElement overlay ([array $opt = null])
RaxanElement parent ([ $selector = null])
RaxanElement parents ([ $selector = null])
RaxanElement position (array $opt)
RaxanElement prepend ( $content)
RaxanElement prependTo ( $selector)
RaxanElement preserveState ([string $mode = null])
RaxanElement prev ([ $selector = null])
RaxanElement prevAll ([ $selector = null])
RaxanElement removeState ([string $mode = null])
RaxanElement replaceAll ( $selector)
RaxanElement replaceClient ( $selector)
RaxanElement replaceWith ( $content)
RaxanElement resizable ([array $opt = null])
void setCustomValidity ( $name,  $message)
RaxanElement siblings ([ $selector = null])
RaxanElement slice ( $start, [ $length = null])
RaxanElement slideDown ([mixed $speed = null])
RaxanElement slideUp ([mixed $speed = null])
void stack ( $elms)
RaxanElement storeName ([ $n = null])
RaxanElement submit (mixed $fn, [strubg $serialize = null])
RaxanElement text ([ $txt = null])
RaxanElement textVal ([ $txt = null])
RaxanElement timeout ( $msTime,  $data, [ $fn = null])
void traverse ( $selector,  $prop1,  $prop2, [ $first = false])
RaxanElement trigger (string $type, [mixed $args = null], [object $eObject = null])
RaxanElement unbind ( $type)
void unstack ([ $all = false])
RaxanElement val ([mixed $v = null])
array validInputs ()
void value ([ $v = null])
RaxanElement width ([ $w = null])
RaxanElement wrap ( $content)
RaxanElement wrapAll ( $content)
void __call ( $name,  $args)
void __get ( $var)
Variables
static mixed $callMethods (line 23)
  • access: protected
mixed $doc (line 26)
  • access: protected
mixed $elms (line 25)
  • access: protected
mixed $_context (line 26)
  • access: protected
mixed $_customValidity (line 31)
  • access: protected
mixed $_invalidInp (line 34)
  • access: protected
mixed $_length (line 30)
  • access: protected
mixed $_modifiedStack (line 31)
  • access: protected
mixed $_rootElm (line 26)
  • access: protected
mixed $_selector (line 26)
  • access: protected
mixed $_stack (line 28)
  • access: protected
mixed $_storeName (line 29)
  • access: protected
mixed $_validInp (line 33)
  • access: protected

Inherited Variables

Inherited from RaxanBase

RaxanBase::$events
RaxanBase::$mObjId
RaxanBase::$objId
Methods
static addMethod (line 1570)

Adds a custom method to the RaxanElement Class. Use addMethod($object) to add multiple methods from an object

  • access: public
static void addMethod ( $name, [ $callback = null])
  • $name
  • $callback
Constructor __construct (line 43)

RaxanElement(css,context)

RaxanElement(html,context)

RaxanElement __construct (mixed $css, [DOMNode $context = null])
  • mixed $css: CSS selector string, array of DOMElements, DOMNode, DOMNodeList or RaxanElement
  • DOMNode $context

Redefinition of:
RaxanBase::__construct()

Redefined in descendants as:
add (line 138)

Adds new elements to the selection based on the specified selector(s)

  • access: public
RaxanElement add ( $selector)
  • $selector
addClass (line 154)

Adds a css class name to matched elements

  • access: public
RaxanElement addClass ( $cls)
  • $cls
after (line 162)

Add content after matched elements

  • access: public
RaxanElement after ( $content)
  • $content
alphanumericVal (line 170)

Returns an alphanumeric value from the selected form element

  • access: public
string alphanumericVal ()
andSelf (line 179)

Add the previous matched selection to the current selection

  • access: public
RaxanElement andSelf ()
append (line 189)

Append content to matched elements

  • access: public
RaxanElement append ( $content)
  • $content
appendTo (line 197)

Append matched elements to selector

  • access: public
RaxanElement appendTo ( $selector)
  • $selector
appendToClient (line 207)

Appends the html of the matched elements to the selected client element.

  • access: public
RaxanElement appendToClient ( $selector)
  • $selector
appendView (line 215)

Appends an html view file to the matched elements

  • access: public
RaxanElement appendView ( $view, [ $selector = null], [ $data = null])
  • $view
  • $selector
  • $data
attr (line 224)

Returns or set attribute on match elements

  • return: or String
  • access: public
RaxanElement attr ( $name, [ $val = null])
  • $name
  • $val
autoId (line 238)

Automatically assign unigue ids to matched elements that are without an id

  • access: public
RaxanElement autoId ([ $idPrefix = null])
  • $idPrefix
before (line 248)

Add content before matched elements

  • access: public
RaxanElement before ( $content)
  • $content
bind (line 264)

Attach an event and a callback function to the matched elements events

This method is also used to bind an array or a PDO result set to the matched elements - See Raxan::bindTemplate()

  • access: public
  • example: example not found
RaxanElement bind (string $type, [mixed $data = null], [mixed $fn = null])
  • string $type: Event type. Example click
  • mixed $data: Optional. Event data to be passed to the callback function
  • mixed $fn: Callback function

Redefinition of:
RaxanBase::bind()
Bind the selected event to a callback function
checkValidity (line 291)

Check validity on form fields.

Supports basic HTML5 validation for email, date, number and url input types. The pattern, required, min and max attributes are also supported. Currenly min/max is only supported for numeric inputs (type=number)

  • access: public
void checkValidity ([boolean $markInvalid = false], [string $cssClass = null], [mixed $callback = null])
  • boolean $markInvalid: Optional. Mark invalid form fields
  • string $cssClass: Optional. Required class
  • mixed $callback: Optional. Custom validation callback
children (line 423)

Selects the immediate children of the matched elements

  • access: public
RaxanElement children ([ $selector = null])
  • $selector
clearNode (line 1469)
  • access: protected
void clearNode ( $n)
  • $n
click (line 433)

An ajax event helper that's used to binds a function to the click event for the matched selection.

  • access: public
RaxanElement click (mixed $fn, [strubg $serialize = null])
  • mixed $fn: Callback function
  • strubg $serialize: CSS selector for elements to be serialized on post back
cloneNodes (line 445)

Clone matched elements and select the clones (alias to the clone() method)

  • access: public
RaxanElement cloneNodes ([ $deep = null])
  • $deep
css (line 457)

Returns or sets CSS property values

  • return: or String
  • access: public
RaxanElement css ( $name, [ $val = null])
  • $name
  • $val
data (line 481)

Returns or sets news data value for the macted elements

  • access: public
Mixed &data ( $name, [ $value = null])
  • $name
  • $value
dateVal (line 491)

Returns formatted a date value from the selected form element

  • access: public
string dateVal ([ $format = null])
  • $format
delegate (line 507)

Binds an event to the selector of the matched elements using event delegation

  • access: public
  • example: example not found
RaxanElement delegate (string $selector, string $type, [mixed $data = null], [mixed $fn = null])
  • string $selector: CSS selector
  • string $type: Event type. Example click
  • mixed $data: Optional. Event data to be passed to the callback function
  • mixed $fn: Callback function
disable (line 519)

Disbable matched elements

  • access: public
RaxanElement disable ()
draggable (line 526)

Make matched elements draggable.

  • access: public
RaxanElement draggable ([array $opt = null])
  • array $opt: Optional. See jQuery Dragabbles
droppable (line 537)

Enable matched elements to accept dropped items and raise the drop event

  • access: public
RaxanElement droppable ([ $opt = null], array $opt.)
  • array $opt.: Optional. See jQuery Droppables
  • $opt
emailVal (line 547)

Returns sanitized email address from the selected form element

  • access: public
string emailVal ()
enable (line 556)

Enable matched elements

  • access: public
RaxanElement enable ()
end (line 563)

Revert the currently modified selection to the previously matched selection

this works if the selection was modified using filter(), find(), eq(), etc

  • access: public
RaxanElement end ([ $all = false])
  • $all
eq (line 572)

Reduces the set of matched elements to a single element

  • access: public
RaxanElement eq ( $index)
  • $index
expose (line 585)

Highlight or expose the matched elements on the screen

  • access: public
RaxanElement expose ([mixed $opt = null])
  • mixed $opt: Optional. Set to false to remove expose
fadeIn (line 598)

Fades in the matched elements

  • access: public
RaxanElement fadeIn ([mixed $speed = null])
  • mixed $speed: Optional. Values include fast, normal, slow or milliseconds. Defaults to normal
fadeOut (line 609)

Fades out the matched elements

  • access: public
RaxanElement fadeOut ([mixed $speed = null])
  • mixed $speed: Optional. Values include fast, normal, slow or milliseconds. Defaults to normal
filter (line 653)

Reduces the matched elements to those that match the selector

  • access: public
RaxanElement filter (string $selector, [boolean $_invert = false])
  • string $selector: CSS selector
  • boolean $_invert: Reduces the set to elements that did NOT match the selector
find (line 668)

Search matched elements for the specified selector(s). Returns the matched results of the search

  • return: Can return either an RaxanElement or an array of matched DOMElement
  • access: public
RaxanElement find ( $selector, [ $returnArray = false])
  • $selector
  • $returnArray
findByXPath (line 681)

Search matched elements for the specified xpath. Returns the matched results of the search

  • return: Can return either an RaxanElement or an array of matched DOMElement
  • access: public
RaxanElement findByXPath ( $xpath, [ $returnArray = false])
  • $xpath
  • $returnArray
floatVal (line 694)

Returns or sets the float value for the selected form element

  • return: or float
  • access: public
RaxanElement floatVal ([ $v = null])
  • $v
get (line 703)

Returns a single element or an array of element

  • return: Returns a single DOMElement or an array of DOMelements if index is null
  • access: public
mixed get ([ $index = null])
  • $index
hasClass (line 713)

Returns true if one element in the matched selection contains the specified class

  • access: public
Boolean hasClass ( $cls)
  • $cls
height (line 743)

Returns or sets the height of the container element

  • access: public
RaxanElement height ([ $h = null])
  • $h
hide (line 727)

Hide matched elements (display:none)

  • access: public
RaxanElement hide ()
hideFromClient (line 733)

Hides the match elements from the client's browser.

  • access: public
RaxanElement hideFromClient ()
html (line 752)

Sets the inner html content of matach elements. Returns only the inner html of the first matched element.

  • return: or String
  • access: public
RaxanElement html ([ $html = null])
  • $html
inputValues (line 620)

Set or return the form input values of the matched elements

  • return: Returns Array or RaxanElement
  • access: public
mixed inputValues ([array $data = null])
  • array $data
insert (line 1475)
  • access: protected
void insert ( $content,  $pos, [ $retNodes = false])
  • $content
  • $pos
  • $retNodes
insertAfter (line 776)

Add matched elements after all selected elements

  • access: public
RaxanElement insertAfter ( $selector)
  • $selector
insertBefore (line 784)

Add matched elements before all selected elements.

  • access: public
RaxanElement insertBefore ( $selector)
  • $selector
intVal (line 793)

Returns or sets the integer value for a form element

  • return: or int
  • access: public
RaxanElement intVal ([ $v = null])
  • $v
invalidInputs (line 407)

Returns an array of invalid field names and their associated validation message as reported by checkvalidity()

  • access: public
array invalidInputs ()
is (line 802)

Returns true is if at least one element matches the selector

  • access: public
Boolean is ( $selector)
  • $selector
isHTML (line 1515)
  • access: protected
void isHTML ( $str)
  • $str
localize (line 814)

Localize matched elements that have a valid locale key/value pair assigned to the langid attribute

  • access: public
RaxanElement localize ()
map (line 826)

Applies a callback to matched elements and returns a new set of elements

Can also be used to filter or replace the matched elements

  • access: public
RaxanElement map ( $fn)
  • $fn
matchSelector (line 840)

Returns the selctor for the match elements

  • access: public
String matchSelector ([ $autoId = false], [ $idPrefix = null])
  • $autoId
  • $idPrefix
matchVal (line 860)

Returns matched characters from the selected form element

  • access: public
string matchVal ([string $pattern = '/[a-zA-Z0-9-.]/'])
  • string $pattern: Optional Regex pattern. Defaults to /[a-zA-Z0-9-.]/
modifyClass (line 1520)
  • access: protected
void modifyClass ( $classes,  $mode)
  • $classes
  • $mode
next (line 869)

Selects the next sibling of the matched elements

  • access: public
RaxanElement next ([ $selector = null])
  • $selector
nextAll (line 877)

Selects the next siblings of the matched elements

  • access: public
RaxanElement nextAll ([ $selector = null])
  • $selector
node (line 704)
  • access: public
void node ([ $index = null])
  • $index
not (line 885)

Remove element matching the specified selector from the set of match elements

  • access: public
RaxanElement not ( $selector)
  • $selector
outerHtml (line 893)

Returns the outer html of the first matched element

  • access: public
string outerHtml ()
overlay (line 904)

Overlays the matched elements on the screen

  • access: public
RaxanElement overlay ([array $opt = null])
  • array $opt: Optional. See jQuery Tools overlay plugin
parent (line 920)

Selects the parent element of the matched elements

  • access: public
RaxanElement parent ([ $selector = null])
  • $selector
parents (line 928)

Selects the ancestors of the matched elements

  • access: public
RaxanElement parents ([ $selector = null])
  • $selector
position (line 937)

Absolutely positioning an element relative to the window, document, a particular element, or the cursor/mouse

  • access: public
RaxanElement position (array $opt)
  • array $opt: Set jQuery Position utility
prepend (line 963)

Prepend content to elements

  • access: public
RaxanElement prepend ( $content)
  • $content
prependTo (line 971)

Prepend matched elements to selector

  • access: public
RaxanElement prependTo ( $selector)
  • $selector
prependToClient (line 980)

Prepends the html of the matched elements to the selected client element.

  • access: public
RaxanElement prependToClient ( $selector)
  • $selector
preserveState (line 989)

Preserves the state of the matched elements

  • access: public
RaxanElement preserveState ([string $mode = null])
  • string $mode: Mode can be set to either local or session. Local - states are preserved during page post back. Session - states are preserved until the session ends.
prev (line 947)

Selects the previous sibling of the matched elements

  • access: public
RaxanElement prev ([ $selector = null])
  • $selector
prevAll (line 955)

Selects the previous siblings of the matched elements

  • access: public
RaxanElement prevAll ([ $selector = null])
  • $selector
remove (line 1024)

Remove matched elements from document

  • access: public
RaxanElement remove ()
removeAttr (line 1037)

Remove attribute from elements

  • access: public
RaxanElement removeAttr ( $cls)
  • $cls
removeChildren (line 1048)
  • access: public
RaxanElement removeChildren ()
removeClass (line 1057)

Removes css class name from elements

  • access: public
RaxanElement removeClass ( $cls)
  • $cls
removeData (line 1065)

Remove data from matched elements

  • access: public
RaxanElement removeData ( $name)
  • $name
removeState (line 1009)

Removes the state of the matched elements

  • access: public
RaxanElement removeState ([string $mode = null])
  • string $mode: Mode can be set to either local or session. Defaults to local
replaceAll (line 1074)

Replace all selected with matched elements

  • access: public
RaxanElement replaceAll ( $selector)
  • $selector
replaceClient (line 1085)

Replaces the selected client-side element with the html of the matched elements.

  • access: public
RaxanElement replaceClient ( $selector)
  • $selector
replaceWith (line 1093)

Replace matched elements with content

  • access: public
RaxanElement replaceWith ( $content)
  • $content
resizable (line 1102)

Make matched elements resizable

  • access: public
RaxanElement resizable ([array $opt = null])
  • array $opt: Optional. See jQuery UI Resizable plugin
selectInnerChild (line 1112)

Selects inner child of match elements - used by wrap functions

  • access: public
RaxanElement selectInnerChild ()
setCustomValidity (line 1127)

Set custom validity message for form fields

  • access: public
  • example: example not found
void setCustomValidity ( $name,  $message)
  • $name
  • $message
show (line 1137)

Show matched elements (display:block)

  • access: public
RaxanElement show ()
showInClient (line 1143)

Show the match elements inside the client's browser if it was previously hidden from the client

  • access: public
RaxanElement showInClient ()
siblings (line 1153)

Selects the siblings of the matched elements

  • access: public
RaxanElement siblings ([ $selector = null])
  • $selector
slice (line 1183)

Selects a subset of the match elements

  • access: public
RaxanElement slice ( $start, [ $length = null])
  • $start
  • $length
slideDown (line 1173)

Show the matched elements using the slide down animation effect

  • access: public
RaxanElement slideDown ([mixed $speed = null])
  • mixed $speed: Optional. Values include fast, normal, slow or milliseconds. Defaults to normal
slideUp (line 1162)

Hide the matched elements using the slide up animation effect

  • access: public
RaxanElement slideUp ([mixed $speed = null])
  • mixed $speed: Optional. Values include fast, normal, slow or milliseconds. Defaults to normal
stack (line 1540)
  • access: protected
void stack ( $elms)
  • $elms
storeName (line 1194)

Sets or returns a date store name for the matched elements

  • return: or String
  • access: public
RaxanElement storeName ([ $n = null])
  • $n
submit (line 1212)

An ajax event helper that's used to binds a function to the submit event for the matched selection.

  • access: public
RaxanElement submit (mixed $fn, [strubg $serialize = null])
  • mixed $fn: Callback function
  • strubg $serialize: CSS selector for elements to be serialized on post back
text (line 1224)

Returns or set text on match elements

  • return: or String
  • access: public
RaxanElement text ([ $txt = null])
  • $txt
textVal (line 1244)

Returns or sets the non-html text value for a form element

  • return: or string
  • access: public
RaxanElement textVal ([ $txt = null])
  • $txt
timeout (line 1253)

Binds a callback function to a timeout event. $msTime - milliseconds

  • access: public
RaxanElement timeout ( $msTime,  $data, [ $fn = null])
  • $msTime
  • $data
  • $fn
toggleClass (line 1267)

Toggle css class name

  • access: public
RaxanElement toggleClass ( $cls)
  • $cls
traverse (line 1446)

Private/protected Methods ----------------------

------------------------------------------------

  • access: protected
void traverse ( $selector,  $prop1,  $prop2, [ $first = false])
  • $selector
  • $prop1
  • $prop2
  • $first
trigger (line 1278)

Trigger events on the match elements

  • access: public
RaxanElement trigger (string $type, [mixed $args = null], [object $eObject = null])
  • string $type: Event Type. Use the @local suffix to only trigger local events
  • mixed $args: Optional arugments to to be passed to event handlers
  • object $eObject: Optional. Original event object to passed to handlers

Redefinition of:
RaxanBase::trigger()
Triggers an event on the object
unbind (line 1287)

Removes all event handlers for the specified event type

  • access: public
RaxanElement unbind ( $type)
  • $type

Redefinition of:
RaxanBase::unbind()
Removes all event handlers for the specified event type
unique (line 1297)

Removes all duplicate elements from the matched set

  • access: public
RaxanElement unique ()
unstack (line 1551)
  • access: protected
void unstack ([ $all = false])
  • $all
updateClient (line 1314)

Update client-side elements with the html content of the matched elements.

  • access: public
RaxanElement updateClient ()
val (line 1327)

Returns or sets the value for a form element

  • return: or String
  • access: public
RaxanElement val ([mixed $v = null])
  • mixed $v: Accepts a string or an array of values
validInputs (line 415)

Returns an array valid field names and their associated values as reported by checkvalidity()

  • access: public
array validInputs ()
value (line 1328)
  • access: public
void value ([ $v = null])
  • $v
width (line 1411)

Returns or sets the width of the container element

  • access: public
RaxanElement width ([ $w = null])
  • $w
wrap (line 1420)

Wrap matched elements inside the specified HTML content or element.

  • access: public
RaxanElement wrap ( $content)
  • $content
wrapAll (line 1431)

Wrap all matched elements inside the specified HTML content or element

  • access: public
RaxanElement wrapAll ( $content)
  • $content
__call (line 110)
  • access: public
void __call ( $name,  $args)
  • $name
  • $args
__get (line 122)
  • access: public
void __get ( $var)
  • $var

Redefined in descendants as:

Inherited Methods

Inherited From RaxanBase

RaxanBase::__construct()
RaxanBase::bind()
RaxanBase::log()
RaxanBase::objectId()
RaxanBase::trigger()
RaxanBase::unbind()