Core.js

MooToolsMy Object Oriented JavaScript Tools.

License

MIT-style license.

Copyright

Copyright © 2006-2008 [Valerio Proietti](http://mad4milk.net/).

Code & Documentation

[The MooTools production team](http://mootools.net/developers/).

Inspiration

Summary
The Browser Core.
Contains Array Prototypes like each, contains, and erase.
Contains Function Prototypes like create, bind, pass, and delay.
Contains Number Prototypes like limit, round, times, and ceil.
Contains String Prototypes like camelCase, capitalize, test, and toInt.
Contains Hash Prototypes.
Contains the Event Native, to make the event object completely crossbrowser.
Contains the Class Function for easily creating, extending, and implementing reusable Classes.
Contains Utility Classes that can be implemented into your own Classes to ease the execution of many common tasks.
One of the most important items in MooTools.
Contains Element methods for dealing with events, and custom Events.
Contains methods for interacting with the styles of Elements in a fashionable way.
Contains methods to work with size, scroll, or positioning of Elements and the window object.
Adds advanced CSS Querying capabilities for targeting elements.
Contains the domready custom event.
JSON encoder and decoder.
Class for creating, loading, and saving browser Cookies.
Wrapper for embedding SWF movies.
Contains the basic animation logic to be extended by all other Fx Classes.
Contains the CSS animation logic.
Formerly Fx.Style, effect to transition any CSS property for an element.
Formerly Fx.Styles, effect to transition any number of CSS properties for an element using an object of rules, or CSS based selector rules.
Contains a set of advanced transitions to be used with any of the Fx Classes.
Powerful all purpose Request Class.
Extends the basic Request Class with additional methods for sending and receiving JSON data.
A css-class based form validation system.
Additional validators for the FormValidator class.
Defines Fx.Reveal, a class that shows and hides elements with a transition.
Effect to slide an element in and out of view.
Class for creating a smooth scrolling effect to all internal links on the page.
A Drag extension that provides support for the constraining of draggables to containers and droppables.
Class for creating horizontal and vertical slider controls.
Defines Request.JSONP, a class for cross domain javascript via script injection.
Requests the same url at a time interval that increases when no data is returned from the requested server
Class for monitoring collections of events
Class for creating, reading, and deleting Cookies in JSON format.
Jx is a global singleton object that contains the entire Jx library within it.
This is the URL that Jx was loaded from, it is automatically calculated from the script tag src property that included Jx.
Static method that applies the PNG Filter Hack for IE browsers when showing 24bit PNG’s.
Request that an image be set to a DOM IMG element src attribute.
An internal method that ensures no more than 2 images are loading at a time.
An internal method actually populate the DOM element with the image source.
Creates a new iframe element that is intended to fill a container to mask out other operating system controls (scrollbars, inputs, buttons, etc) when HTML elements are supposed to be above them.
safely parse a number and return its integer value.
return the dimensions of the browser client area.
Element is a global object provided by the mootools library.
return the size of the content area of an element.
return the size of the border area of an element.
return the size of the margin area of an element.
set either or both of the width and height of an element to the provided size.
set either or both of the width and height of an element to the provided size.
returns the padding for each edge of an element
returns the border size for each edge of an element
determines if the element is a descendent of the reference node.
search the parentage of the element to find an element of the given tag name.
ContentLoader is a mix-in class that provides a consistent mechanism for other Jx controls to load content in one of four different ways:
tracks the load state of the content, specifically useful in the case of remote content.
triggers loading of content based on options set for the current object.
Is fired after a delay to check the request to make sure it’s not failing in AIR.
Mix-in class that provides a method for positioning elements relative to other elements.
positions an element relative to another element based on the provided options.
A mix-in class that provides chrome helper functions.
the DOM element that contains the chrome
create chrome on an element.
show the chrome on an element.
removes the chrome from the DOM.
A mix-in class that provides a helper function that allows an object to be added to an existing element on the page.
adds the object to the DOM relative to another element.
Extends: Object
create a new button.
triggered when the user clicks the button, processes the actionPerformed event
This returns true if the button is enabled, false otherwise
enable or disable the button.
For toggle buttons, this returns true if the toggle button is currently active and false otherwise.
Set the active state of the button
set the image of this button to a new image URL
sets the text of the button.
returns the text of the button.
sets the tooltip displayed by the button
capture the keyboard focus on this button
remove the keyboard focus from this button
Extends: Jx.Button
the HTML element that contains the flyout content
construct a new instance of a flyout button.
Override Jx.Button::clicked to hide/show the content area of the flyout.
Closes the flyout if open
Extends: Object
Create a new instance of Jx.Layout.
when the window is resized, any Jx.Layout controlled elements that are direct children of the BODY element are resized
resize the element controlled by this Jx.Layout object.
Extends: Jx.Button
{HTMLElement} The content area that is displayed when the tab is active.
Create a new instance of Jx.Button.Tab.
triggered when the user clicks the button, processes the actionPerformed event
Extends: Object
the HTML element representing the color panel
initialize a new instance of Jx.ColorPalette
handle the mouse moving over a colour swatch by updating the preview
handle mouse click on a swatch by updating the color and hiding the panel.
handle the user entering a new colour value manually by updating the selected colour if the entered value is valid HEX.
handle the user entering a new alpha value manually by updating the selected alpha if the entered value is valid alpha (0-100).
set the colour represented by this colour panel
set the alpha represented by this colour panel
update the colour panel user interface based on the current colour and alpha values
initialize a new color button.
override Jx.Button.Flyout to use a singleton color palette.
hide the color panel
set the color represented by this color panel
set the alpha represented by this color panel
handle the color changing in the palette by updating the preview swatch in the button and firing the change event.
Update the swatch color for the current color
Extends: Object
{HTMLElement} The HTML element containing the menu.
{Jx.Button} The button that represents this menu in a toolbar and opens the menu.
{HTMLElement} the HTML element that contains the menu items within the menu.
{Array} the items in this menu
Create a new instance of Jx.Menu.
Add menu items to the sub menu.
Deactivate the menu by hiding it.
Handle the user moving the mouse over the button for this menu by showing this menu and hiding the other menu.
determine if an event happened inside this menu or a sub menu of this menu.
Hide the menu.
Show the menu
Set the sub menu that is currently open
Extends: Object
{Array} array of buttons that are managed by this button set
Create a new instance of Jx.ButtonSet
Add one or more Jx.Buttons to the ButtonSet.
Remove a button from this Button.
Set the active button to the one passed to this method
Handle selection changing on the buttons themselves and activate the appropriate button in response.
Extends: Jx.Button
the currently selected button
{Array} the buttons added to this multi button
construct a new instance of Jx.Button.Multi.
adds one or more buttons to the Multi button.
remove a button from a multi button
update the menu item to be the requested button.
update the active button in the menu item, trigger the button’s action and hide the flyout that contains the buttons.
Extends: Jx.Button
{<Jx.SubMenu> or Jx.Menu} the menu that contains the menu item.
Create a new instance of Jx.Menu.Item
Set the owner of this menu item
Hide the menu item.
Show the menu item
Handle the user clicking on the menu item, overriding the Jx.Button::clicked method to facilitate menu tracking
handle the mouse moving over the menu item
{Object} current selection in the list
create a new instance of Jx.Combo
enable or disable the combo button.
invoked when the current value is changed
Handle the user pressing a key by looking for an ENTER key to set the value.
add a new item to the pick list
Remove the item at the given index.
set the value of the Combo
Return the current value
Extends: Object
Initialize a new Jx.Panel instance
the sizeChange event of the Jx.Layout that manages the outer container is intercepted and passed through this method to handle resizing of the panel contents because we need to do some calculations if the panel is collapsed and if there are toolbars to put around the content area.
Set the label in the title bar of this panel
Get the label of the title bar of this panel
Clean up the panel
Maximize this panel
set the content of this panel to some HTML
Set the content of this panel to come from some URL.
When the content of the panel is loaded from a remote URL, this method is called when the ajax request returns.
Set the panel as busy or not busy, which displays a loading image in the title bar.
sets or toggles the collapsed state of the panel.
Closes the panel (completely hiding it).
Extends: Jx.Panel
modal dialogs prevent interaction with the rest of the application while they are open, this element is displayed just under the dialog to prevent the user from clicking anything.
Construct a new instance of Jx.Dialog
resize the dialog.
overload panel’s sizeChanged method
sets or toggles the collapsed state of the panel.
show the dialog, external code should use the Jx.Dialog::open method to make the dialog visible.
hide the dialog, external code should use the Jx.Dialog::close method to hide the dialog.
open the dialog and load content from the provided url.
open the dialog.
close the dialog and trigger the onClose callback function if necessary
Extends: Object
{HTMLElement} the element being split
{Array} an array of elements that are displayed in each of the split areas
{Array} an array of the bars between each of the elements used to resize the split areas.
{Boolean} track the first resize event so that unexposed Jx things can be forced to calculate their size the first time they are exposed.
Create a new instance of Jx.Splitter
Prepare a new, empty element to go into a split area.
Prepare a new, empty bar to go into between split areas.
Setup the initial set of constraints that set the behaviour of the bars between the elements in the split area.
In a horizontally split container, handle a bar being dragged left or right by resizing the elements on either side of the bar.
In a vertically split container, handle a bar being dragged up or down by resizing the elements on either side of the bar.
handle the size of the container being changed.
Resize a horizontally layed-out container
Resize a vertically layed out container.
Extends: Object
{Array} the panels being managed by the set
{Integer} the height of the container, cached for speed
{Boolean} true until the panel set has first been resized
Create a new instance of Jx.PanelSet.
Maximize a panel, taking up all available space (taking into consideration any minimum or maximum values)
Extends: Object
construct a new instance of Jx.Grid within the domObj
handle the grid scrolling by updating the position of the headers
resize the grid to fit inside its container.
set the model for the grid to display.
destroy the contents of the grid safely
create the grid for the current model
set the height of a row.
called through the grid listener interface when data has changed in the underlying model
apply the jxGridRowHeaderPrelight style to the header cell of a row.
apply the jxGridColumnHeaderPrelight style to the header cell of a column.
apply the jxGridRowPrelight style to row.
apply the jxGridColumnPrelight style to a column.
apply the jxGridCellPrelight style to a cell.
Select a cell and apply the jxGridCellSelected style to it.
Apply the jxGridRowHeaderSelected style to the row header cell of a selected row.
Select a row and apply the jxGridRowSelected style to it.
Apply the jxGridColumnHeaderSelected style to the column header cell of a selected column.
Select a column.
handle the mouse moving over the main grid.
handle the mouse moving over the row header cells.
handle the mouse moving over the column header cells.
handle the user clicking on the grid.
handle the user clicking on the row header.
handle the user clicking on the column header.
retrieve the row and column indexes from an event click.
create a new grid model
This function returns the number of columns of data in the model as an integer value.
This function returns an HTML string to be placed in the column header for the given column index.
This function returns an integer which is the height of the column header row in pixels.
This function returns an integer which is the width of the given column in pixels.
This function returns an HTML string to be placed in the row header for the given row index
This function returns an integer which is the width of the row header column in pixels.
This function returns an integer which is the height of the given row in pixels.
This function returns the number of rows of data in the model as an integer value.
This function returns an HTML string which is the text to place in the cell at the given row and column.
This function is called with a column index and width in pixels when a column is resized.
This function returns a boolean value to indicate if a given cell is editable by the user.
This function is called with the row and column of a cell and a new value for the cell.
This function is called by the grid to indicate that the user has selected a row by clicking on the row header.
This function is called by the grid to indicate that the user has selected a column by clicking on the column header.
This function is called by the grid to indicate that the user has selected a cell by clicking on the cell in the grid.
Extends: Jx.Menu
create a new context menu
Show the context menu at the location of the mouse click
Extends: Object
{HTMLElement} the HTML element that the separator is contained within
{Jx.Menu, Jx.Menu.SubMenu} the menu that the separator is in.
Create a new instance of a menu separator
Set the ownder of this menu item
Hide the menu item.
Show the menu item
Extends: Jx.Menu.Item
{HTMLElement} the HTML container for the sub menu.
{Jx.Menu or Jx.SubMenu} the menu or sub menu that this sub menu belongs
{<Jx.MenuItem>} the visible item within the menu
{Array} the menu items that are in this sub menu.
Create a new instance of Jx.SubMenu
Set the owner of this sub menu
Show the sub menu
Hide the sub menu
Add menu items to the sub menu.
Insert a menu item before another menu item.
Remove a single menu item from the menu.
Deactivate the sub menu
Indicate if this sub menu is active
Set the active state of the Jx.Menu that contains this sub menu
Set a sub menu of this menu to be visible and hide the previously visible one.
Extends: Object
{HTMLElement} the DOM element of the snap (the thing that gets clicked).
{HTMLElement} An element of the Jx.Splitter that gets controlled by this snap
{Jx.Splitter} the splitter that this snap is associated with.
{String} track the layout of the splitter for convenience.
Create a new Jx.Splitter.Snap
Snap the element open or closed.
Handle the size of the element changing to see if the toggle state has changed.
Extends: Object
{Array} an array of the things in the toolbar.
{HTMLElement} the HTML element that the toolbar lives in
When a toolbar contains Jx.Menu instances, they want to know if any menu in the toolbar is active and this is how they find out.
Create a new instance of Jx.Toolbar.
add this toolbar to a DOM element automatically creating a toolbar container if necessary
Add an item to the toolbar.
remove an item from a toolbar.
Deactivate the Toolbar (when it is acting as a menu bar).
Indicate if the toolbar is currently active (as a menu bar)
Set the active state of the toolbar (for menus)
For menus, they want to know which menu is currently open.
Extends: Object
{Array} array of tabs that are managed by this tab set
{HTMLElement} The HTML element that represents this tab set in the DOM.
Create a new instance of Jx.TabSet within a specific element of the DOM.
Resize the tab set content area and propogate the changes to each of the tabs managed by the tab set.
Add one or more Jx.Button.Tabs to the TabSet.
Remove a tab from this TabSet.
Set the active tab to the one passed to this method
Extends: Object
{Jx.Toolbar} the toolbar for this tab box.
{Jx.TabSet} the tab set for this tab box.
Create a new instance of a TabBox.
Add one or more <Jx.Tab>s to the TabBox.
Remove a tab from the TabSet.
Extends: Object
{HTMLElement} the HTML element that the container lives in
Create a new instance of Jx.Toolbar.Container
Add a toolbar to the container.
remove an item from a toolbar.
scrolls an item in one of the toolbars into the currently visible area of the container if it is not already fully visible
Extends: Object
{HTMLElement} an element to contain the thing to be placed in the toolbar.
Create a new instance of Jx.Toolbar.Item.
Extends: Object
{HTMLElement} The DOM element that goes in the Jx.Toolbar
Create a new Jx.Toolbar.Separator
Extends: Object
{HTMLElement} a reference to the HTML element that is the TreeItem in the DOM
{Object} the folder or tree that this item belongs to
Create a new instance of Jx.TreeItem with the associated options
Clean up the TreeItem and remove all DOM references
Clean up the TreeItem and remove all DOM references
Create a clone of the TreeItem
Update the CSS of the TreeItem’s DOM element in case it has changed position
Called when the DOM element for the TreeItem is clicked, the node is selected.
Get the label associated with a TreeItem
A property of an object has changed, synchronize the state of the TreeItem with the state of the object
Extends: Jx.TreeItem
{HTMLElement} an HTML container for the things inside the folder
{Array} an array of references to the javascript objects that are children of this folder
Create a new instance of Jx.TreeFolder
Clean up a TreeFolder.
Internal method to clean up folder-related stuff.
Create a clone of the TreeFolder
Indicates if a node is the last thing in the folder.
Update the CSS of the TreeFolder’s DOM element in case it has changed position.
append a node at the end of the sub-tree
insert a node after refNode.
remove the specified node from the tree
Replace a node with another node
handle the user clicking on this folder by expanding or collapsing it.
Expands the folder
Collapses the folder
Get a reference to a child node by recursively searching the tree
Extends: Jx.TreeFolder
Create a new instance of Jx.Tree
Clean up a Jx.Tree instance
Clear the tree of all child nodes
Update the CSS of the Tree’s DOM element in case it has changed position
Append a node at the end of the sub-tree

Files

Browser.js

The Browser Core.  Contains Browser initialization, Window and Document, and the Browser Hash.

License

MIT-style license.

Array.js

Contains Array Prototypes like each, contains, and erase.

License

MIT-style license.

Function.js

Contains Function Prototypes like create, bind, pass, and delay.

License

MIT-style license.

Number.js

Contains Number Prototypes like limit, round, times, and ceil.

License

MIT-style license.

String.js

Contains String Prototypes like camelCase, capitalize, test, and toInt.

License

MIT-style license.

Hash.js

Contains Hash Prototypes.  Provides a means for overcoming the JavaScript practical impossibility of extending native Objects.

License

MIT-style license.

Event.js

Contains the Event Native, to make the event object completely crossbrowser.

License

MIT-style license.

Class.js

Contains the Class Function for easily creating, extending, and implementing reusable Classes.

License

MIT-style license.

Class. Extras.js

Contains Utility Classes that can be implemented into your own Classes to ease the execution of many common tasks.

License

MIT-style license.

Element.js

One of the most important items in MooTools.  Contains the dollar function, the dollars function, and an handful of cross-browser, time-saver methods to let you easily work with HTML Elements.

License

MIT-style license.

Element. Event.js

Contains Element methods for dealing with events, and custom Events.

License

MIT-style license.

Element. Style.js

Contains methods for interacting with the styles of Elements in a fashionable way.

License

MIT-style license.

Element. Dimensions.js

Contains methods to work with size, scroll, or positioning of Elements and the window object.

License

MIT-style license.

Credits

Selectors.js

Adds advanced CSS Querying capabilities for targeting elements.  Also includes pseudoselectors support.

License

MIT-style license.

Domready.js

Contains the domready custom event.

License

MIT-style license.

JSON.js

JSON encoder and decoder.

License

MIT-style license.

See Also

http://www.json.org/

Cookie.js

Class for creating, loading, and saving browser Cookies.

License

MIT-style license.

Credits

Based on the functions by Peter-Paul Koch (http://quirksmode.org).

Swiff.js

Wrapper for embedding SWF movies.  Supports (and fixes) External Interface Communication.

License

MIT-style license.

Credits

Flash detection & Internet Explorer + Flash Player 9 fix inspired by SWFObject.

Fx.js

Contains the basic animation logic to be extended by all other Fx Classes.

License

MIT-style license.

Fx. CSS.js

Contains the CSS animation logic.  Used by Fx.Tween, Fx.Morph, Fx.Elements.

License

MIT-style license.

Fx. Tween.js

Formerly Fx.Style, effect to transition any CSS property for an element.

License

MIT-style license.

Fx. Morph.js

Formerly Fx.Styles, effect to transition any number of CSS properties for an element using an object of rules, or CSS based selector rules.

License

MIT-style license.

Fx. Transitions.js

Contains a set of advanced transitions to be used with any of the Fx Classes.

License

MIT-style license.

Credits

Easing Equations by Robert Penner, http://www.robertpenner.com/easing/, modified and optimized to be used with MooTools.

Request.js

Powerful all purpose Request Class.  Uses XMLHTTPRequest.

License

MIT-style license.

Request. JSON.js

Extends the basic Request Class with additional methods for sending and receiving JSON data.

License

MIT-style license.

FormValidator.js

A css-class based form validation system.

License

MIT-style license.

Authors

Aaron Newton

FormValidator. Extras.js

Additional validators for the FormValidator class.

License

MIT-style license.

Authors

Aaron Newton

Fx. Reveal.js

Defines Fx.Reveal, a class that shows and hides elements with a transition.

License

MIT-style license.

Authors

Aaron Newton

Fx. Slide.js

Effect to slide an element in and out of view.

License

MIT-style license.

Authors

Valerio Proietti

Fx. SmoothScroll.js

Class for creating a smooth scrolling effect to all internal links on the page.

License

MIT-style license.

Authors

Valerio Proietti

Drag. Move.js

A Drag extension that provides support for the constraining of draggables to containers and droppables.

License

MIT-style license.

Authors

Valerio Proietti Tom Occhinno Jan Kassens

Slider.js

Class for creating horizontal and vertical slider controls.

License

MIT-style license.

Authors

Valerio Proietti

Request. JSONP.js

Defines Request.JSONP, a class for cross domain javascript via script injection.

License

MIT-style license.

Authors

Aaron Newton Guillermo Rauch

Request. Periodical.js

Requests the same url at a time interval that increases when no data is returned from the requested server

License

MIT-style license.

Authors

Christoph Pojer

Group.js

Class for monitoring collections of events

License

MIT-style license.

Authors

Valerio Proietti

Hash. Cookie.js

Class for creating, reading, and deleting Cookies in JSON format.

License

MIT-style license.

Authors

Valerio Proietti Aaron Newton

Jx

Jx is a global singleton object that contains the entire Jx library within it.  All Jx functions, attributes and classes are accessed through the global Jx object.  Jx should not create any other global variables, if you discover that it does then please report it as a bug

License

Copyright © 2008, DM Solutions Group Inc.

This file is licensed under an MIT style license

Summary
This is the URL that Jx was loaded from, it is automatically calculated from the script tag src property that included Jx.
Static method that applies the PNG Filter Hack for IE browsers when showing 24bit PNG’s.
Request that an image be set to a DOM IMG element src attribute.
An internal method that ensures no more than 2 images are loading at a time.
An internal method actually populate the DOM element with the image source.
Creates a new iframe element that is intended to fill a container to mask out other operating system controls (scrollbars, inputs, buttons, etc) when HTML elements are supposed to be above them.
safely parse a number and return its integer value.
return the dimensions of the browser client area.

Properties

{String} baseURL

This is the URL that Jx was loaded from, it is automatically calculated from the script tag src property that included Jx.

Note that this assumes that you are loading Jx from a js/ or lib/ folder in parallel to the images/ folder that contains the various images needed by Jx components.  If you have a different folder structure, you can define Jx’s base by including the following before including the jxlib javascript file:

Jx = {
baseURL: 'some/path'
}

Functions

applyPNGFilter

Jx.applyPNGFilter = function(o)

Static method that applies the PNG Filter Hack for IE browsers when showing 24bit PNG’s.  Used automatically for img tags with a class of png24.

The filter is applied using a nifty feature of IE that allows javascript to be executed as part of a CSS style rule - this ensures that the hack only gets applied on IE browsers.

The CSS that triggers this hack is only in the ie6.css files of the various themes.

Parameters

object {Object} the object (img) to which the filter needs to be applied.

addToImgQueue

Jx.addToImgQueue = function(obj)

Request that an image be set to a DOM IMG element src attribute.  This puts the image into a queue and there are private methods to manage that queue and limit image loading to 2 at a time.

Parameters

obj{Object} an object containing an element and src property, where element is the element to update and src is the url to the image.

checkImgQueue

Jx.checkImgQueue = function()

An internal method that ensures no more than 2 images are loading at a time.

loadNextImg

Jx.loadNextImg = function()

An internal method actually populate the DOM element with the image source.

createIframeShim

Jx.createIframeShim = function()

Creates a new iframe element that is intended to fill a container to mask out other operating system controls (scrollbars, inputs, buttons, etc) when HTML elements are supposed to be above them.

Returns

an HTML iframe element that can be inserted into the DOM.

getNumber

Jx.getNumber = function(n,
def)

safely parse a number and return its integer value.  A NaN value returns 0.  CSS size values are also parsed correctly.

Parameters

n{Mixed} the string or object to parse.

Returns

{Integer} the integer value that the parameter represents

getPageDimensions

Jx.getPageDimensions = function()

return the dimensions of the browser client area.

Returns

{Object} an object containing a width and height property that represent the width and height of the browser client area.

Element

Element is a global object provided by the mootools library.  The functions documented here are extensions to the Element object provided by Jx to make cross-browser compatibility easier to achieve.  Most of the methods are measurement related.

While the code in these methods has been converted to use MooTools methods, there may be better MooTools methods to use to accomplish these things.  Ultimately, it would be nice to eliminate most or all of these and find the MooTools equivalent or convince MooTools to add them.

Summary
return the size of the content area of an element.
return the size of the border area of an element.
return the size of the margin area of an element.
set either or both of the width and height of an element to the provided size.
set either or both of the width and height of an element to the provided size.
returns the padding for each edge of an element
returns the border size for each edge of an element
determines if the element is a descendent of the reference node.
search the parentage of the element to find an element of the given tag name.

Functions

getContentBoxSize

getContentBoxSize : function()

return the size of the content area of an element.  This is the size of the element less margins, padding, and borders.

Parameters

elem{Object} the element to get the content size of.

Returns

{Object} an object with two properties, width and height, that are the size of the content area of the measured element.

getBorderBoxSize

getBorderBoxSize: function()

return the size of the border area of an element.  This is the size of the element less margins.

Parameters

elem{Object} the element to get the border sizing of.

Returns

{Object} an object with two properties, width and height, that are the size of the border area of the measured element.

getMarginBoxSize

getMarginBoxSize: function()

return the size of the margin area of an element.  This is the size of the element plus margins.

Parameters

elem{Object} the element to get the margin sizing of.

Returns

{Object} an object with two properties, width and height, that are the size of the margin area of the measured element.

setContentBoxSize

setContentBoxSize : function(size)

set either or both of the width and height of an element to the provided size.  This function ensures that the content area of the element is the requested size and the resulting size of the element may be larger depending on padding and borders.

Parameters

elem{Object} the element to set the content area of.
size{Object} an object with a width and/or height property that is the size to set the content area of the element to.

setBorderBoxSize

setBorderBoxSize : function(size)

set either or both of the width and height of an element to the provided size.  This function ensures that the border size of the element is the requested size and the resulting content areaof the element may be larger depending on padding and borders.

Parameters

elem{Object} the element to set the border size of.
size{Object} an object with a width and/or height property that is the size to set the content area of the element to.

getPaddingSize

getPaddingSize : function ()

returns the padding for each edge of an element

Parameters

elem{Object} The element to get the padding for.

Returns

{Object} an object with properties left, top, right and bottom that contain the associated padding values.

getBorderSize

getBorderSize : function()

returns the border size for each edge of an element

Parameters

elem{Object} The element to get the borders for.

Returns

{Object} an object with properties left, top, right and bottom that contain the associated border values.

descendantOf

descendantOf: function(node)

determines if the element is a descendent of the reference node.

Parameters

node{HTMLElement} the reference node

Returns

{Boolean} true if the element is a descendent, false otherwise.

findElement

findElement: function(type)

search the parentage of the element to find an element of the given tag name.

Parameters

type{String} the tag name of the element type to search for

Returns

{HTMLElement} the first node (this one or first parent) with the requested tag name or false if none are found.

Jx. ContentLoader

ContentLoader is a mix-in class that provides a consistent mechanism for other Jx controls to load content in one of four different ways:

  • using an existing element, by id
  • using an existing element, by object reference
  • using an HTML string
  • using a URL to get the content remotely

Use the Implements syntax in your Class to add Jx.ContentLoader to your class.

Option: content content may be an HTML element reference, the id of an HTML element already in the DOM, or an HTML string that becomes the inner HTML of the element.

Option: contentURL the URL to load content from

Summary
tracks the load state of the content, specifically useful in the case of remote content.
triggers loading of content based on options set for the current object.
Is fired after a delay to check the request to make sure it’s not failing in AIR.

Properties

contentIsLoaded

tracks the load state of the content, specifically useful in the case of remote content.

Functions

loadContent

loadContent: function(element)

triggers loading of content based on options set for the current object.

Parameters

element{Object} the element to insert the content into

Events

ContentLoader adds the following events to an object.  You can register for these events using the addEvent method or by providing callback functions via the on{EventName} properties in the options object

contentLoadedcalled when the content has been loaded.  If the content is not asynchronous then this is called before loadContent returns.
contentLoadFailedcalled if the content fails to load, primarily useful when using the contentURL method of loading content.

checkRequest()

checkRequest: function()

Is fired after a delay to check the request to make sure it’s not failing in AIR.

Jx. AutoPosition

Mix-in class that provides a method for positioning elements relative to other elements.

Summary
positions an element relative to another element based on the provided options.

Functions

position

position: function(element,
relative,
options)

positions an element relative to another element based on the provided options.  Positioning rules are a string with two space-separated values.  The first value references the parent element and the second value references the thing being positioned.  In general, multiple rules can be considered by passing an array of rules to the horizontal and vertical options.  The position method will attempt to position the element in relation to the relative element using the rules specified in the options.  If the element does not fit in the viewport using the rule, then the next rule is attempted.  If all rules fail, the last rule is used and element may extend outside the viewport.  Horizontal and vertical rules are processed independently.

Horizontal Positioning

Horizontal values are ‘left’, ‘center’, ‘right’, and numeric values.  Some common rules are:

  • ’left left’ is interpreted as aligning the left edge of the element to be positioned with the left edge of the reference element.
  • ’right right’ aligns the two right edges.
  • ’right left’ aligns the left edge of the element to the right of the reference element.
  • ’left right’ aligns the right edge of the element to the left edge of the reference element.

Vertical Positioning

Vertical values are ‘top’, ‘center’, ‘bottom’, and numeric values.  Some common rules are:

  • ’top top’ is interpreted as aligning the top edge of the element to be positioned with the top edge of the reference element.
  • ’bottom bottom’ aligns the two bottom edges.
  • ’bottom top’ aligns the top edge of the element to the bottom of the reference element.
  • ’top bottom’ aligns the bottom edge of the element to the top edge of the reference element.

Parameters

elementthe element to position
relativethe element to position relative to
optionsthe positioning options, see list below.

Options

horizontalthe horizontal positioning rule to use to position the element.  Valid values are ‘left’, ‘center’, ‘right’, and a numeric value.  The default value is ‘center center’.
verticalthe vertical positioning rule to use to position the element.  Valid values are ‘top’, ‘center’, ‘bottom’, and a numeric value.  The default value is ‘center center’.
offsetsan object containing numeric pixel offset values for the object being positioned as top, right, bottom and left properties.

Jx. Chrome

A mix-in class that provides chrome helper functions.  Chrome is the extraneous visual element that provides the look and feel to some elements i.e. dialogs.  Chrome is added inside the element specified but may bleed outside the element to provide drop shadows etc.  This is done by absolutely positioning the chrome objects in the container based on calculations using the margins, borders, and padding of the jxChrome class and the element it is added to.

Chrome can consist of either pure CSS border and background colors, or a background-image on the jxChrome class.  Using a background-image on the jxChrome class creates four images inside the chrome container that are positioned in the top-left, top-right, bottom-left and bottom-right corners of the chrome container and are sized to fill 50% of the width and height.  The images are positioned and clipped such that the appropriate corners of the chrome image are displayed in those locations.

Summary
the DOM element that contains the chrome
create chrome on an element.
show the chrome on an element.
removes the chrome from the DOM.

Properties

chrome

the DOM element that contains the chrome

Functions

makeChrome

makeChrome: function(element)

create chrome on an element.

Parameters

element{HTMLElement} the element to put the chrome on.

showChrome

showChrome: function(element)

show the chrome on an element.  This creates the chrome if necessary.  If the chrome has been previously created and not removed, you can call this without an element and it will just resize the chrome within its existing element.  You can also pass in a different element from which the chrome was previously attached to and it will move the chrome to the new element.

Parameters

element{HTMLElement} the element to show the chrome on.

hideChrome

hideChrome: function()

removes the chrome from the DOM.  If you do this, you can’t call showChrome with no arguments.

Jx. Addable

A mix-in class that provides a helper function that allows an object to be added to an existing element on the page.

Summary
adds the object to the DOM relative to another element.

Functions

addTo

addTo: function(reference,
where)

adds the object to the DOM relative to another element.  If you use ‘top’ or ‘bottom’ then the element is added to the relative element (becomes a child node).  If you use ‘before’ or ‘after’ then the element is inserted adjacent to the reference node.

Parameters

reference{Object} the DOM element or id of a DOM element to append the object relative to
where{String} where to append the element in relation to the reference node.  Can be ‘top’, ‘bottom’, ‘before’ or ‘after’.  The default is ‘bottom’.

Returns

the object itself, which is useful for chaining calls together

Jx. Button

Extends: Object

Implements: Options, Events, Jx.Addable

Jx.Button creates a clickable element that can be added to a web page.  When the button is clicked, it fires a ‘click’ event.

The CSS styling for a button is controlled by several classes related to the various objects in the button’s HTML structure:

<div class="jxButtonContainer">
<a class="jxButton">
<span class="jxButtonContent">
<img class="jxButtonIcon" src="image_url">
<span class="jxButtonLabel">button label</span>
</span>
</a>
</div>

The CSS classes will change depending on the type option passed to the constructor of the button.  The default type is Button.  Passing another value such as Tab will cause all the CSS classes to change from jxButton to jxTab.  For example:

<div class="jxTabContainer">
<a class="jxTab">
<span class="jxTabContent">
<img class="jxTabIcon" src="image_url">
<span class="jxTabLabel">tab label</span>
</span>
</a>
</div>

When you construct a new instance of Jx.Button, the button does not automatically get inserted into the web page.  Typically a button is used as part of building another capability such as a Jx.Toolbar.  However, if you want to manually insert the button into your application, you may use the addTo method to append or insert the button into the page.

There are two modes for a button, normal and toggle.  A toggle button has an active state analogous to a checkbox.  A toggle button generates different events (down and up) from a normal button (click).  To create a toggle button, pass toggle: true to the Jx.Button constructor.

To use a Jx.Button in an application, you should to register for the ‘click’ event.  You can pass a function in the ‘onClick’ option when constructing a button or you can call the addEvent(‘click’, myFunction) method.  The addEvent method can be called several times, allowing more than one function to be called when a button is clicked.  You can use the removeEvent(‘click’, myFunction) method to stop receiving click events.

Example

var button = new Jx.Button(options);
button.addTo('myListItem'); // the id of an LI in the page.
Example:
var options = {
imgPath: 'images/mybutton.png',
tooltip: 'click me!',
label: 'click me',
onClick: function() {
alert('you clicked me');
}
};
var button = new Jx.Button(options);
button.addEvent('click', anotherFunction);

function anotherFunction() {
alert('a second alert for a single click');
}

Events

clickthe button was pressed and released (only if type is not ‘toggle’).
downthe button is down (only if type is ‘toggle’)
upthe button is up (only if the type is ‘toggle’).

License

Copyright © 2008, DM Solutions Group Inc.

This file is licensed under an MIT style license

Summary
create a new button.
triggered when the user clicks the button, processes the actionPerformed event
This returns true if the button is enabled, false otherwise
enable or disable the button.
For toggle buttons, this returns true if the toggle button is currently active and false otherwise.
Set the active state of the button
set the image of this button to a new image URL
sets the text of the button.
returns the text of the button.
sets the tooltip displayed by the button
capture the keyboard focus on this button
remove the keyboard focus from this button

Functions

Jx. Button

create a new button.

Parameters

options{Object} an object containing optional properties for this button as below.

clicked

clicked : function(evt)

triggered when the user clicks the button, processes the actionPerformed event

Parameters

evt{Event} the user click event

isEnabled

isEnabled: function()

This returns true if the button is enabled, false otherwise

Returns

{Boolean} whether the button is enabled or not

setEnabled

setEnabled: function(enabled)

enable or disable the button.

Parameters

enabled{Boolean} the new enabled state of the button

isActive

isActive: function()

For toggle buttons, this returns true if the toggle button is currently active and false otherwise.

Returns

{Boolean} the active state of a toggle button

setActive

setActive: function(active)

Set the active state of the button

Parameters

active{Boolean} the new active state of the button

setImage

setImage: function(path)

set the image of this button to a new image URL

Parameters

path{String} the new url to use as the image for this button

setLabel

setLabel: function(label)

sets the text of the button.  Only works if a label was supplied when the button was constructed

Parameters

label{String} the new label for the button

getLabel

getLabel: function()

returns the text of the button.

setTooltip

setTooltip: function(tooltip)

sets the tooltip displayed by the button

Parameters

tooltip{String} the new tooltip

focus

focus: function()

capture the keyboard focus on this button

blur

blur: function()

remove the keyboard focus from this button

Jx. Button. Flyout

Extends: Jx.Button

Implements: Jx.ContentLoader, Jx.AutoPosition, Jx.Chrome

Flyout buttons expose a panel when the user clicks the button.  The panel can have arbitrary content.  You must provide any necessary code to hook up elements in the panel to your application.

When the panel is opened, the ‘open’ event is fired.  When the panel is closed, the ‘close’ event is fired.  You can register functions to handle these events in the options passed to the constructor (onOpen, onClose).

The user can close the flyout panel by clicking the button again, by clicking anywhere outside the panel and other buttons, or by pressing the ‘esc’ key.

Flyout buttons implement Jx.ContentLoader which provides the hooks to insert content into the Flyout element.  Note that the Flyout element is not appended to the DOM until the first time it is opened, and it is removed from the DOM when closed.

It is generally best to specify a width and height for your flyout content area through CSS to ensure that it works correctly across all browsers.  You can do this for all flyouts using the .jxFlyout CSS selector, or you can apply specific styles to your content elements.

A flyout closes other flyouts when it is opened.  It is possible to embed flyout buttons inside the content area of another flyout button.  In this case, opening the inner flyout will not close the outer flyout but it will close any other flyouts that are siblings.

Example

var flyout = new Jx.Button.Flyout({
label: 'flyout',
content: 'flyoutContent',
onOpen: function(flyout) {
console.log('flyout opened');
},
onClose: function(flyout) {
console.log('flyout closed');
}
});

Events

openthis event is triggered when the flyout is opened.
closethis event is triggered when the flyout is closed.

License

Copyright © 2008, DM Solutions Group Inc.

This file is licensed under an MIT style license

Summary
the HTML element that contains the flyout content
construct a new instance of a flyout button.
Override Jx.Button::clicked to hide/show the content area of the flyout.
Closes the flyout if open

Properties

content

the HTML element that contains the flyout content

Functions

initialize

initialize: function(options)

construct a new instance of a flyout button.  The single options argument takes a combination of options that apply to Jx.Button, Jx.ContentLoader, and Jx.AutoPosition.

Parameters

optionsan options object used to initialize the button, see <Jx.Button.Options>, <Jx.ContentLoader.Options>, and <Jx.AutoPosition.Options> for details.

clicked

clicked: function(e)

Override Jx.Button::clicked to hide/show the content area of the flyout.

Parameters

e{Event} the user event

hide

hide: function()

Closes the flyout if open

Jx. Layout

Extends: Object

Implements: Options, Events

Jx.Layout is used to provide more flexible layout options for applications

Jx.Layout wraps an existing DOM element (typically a div) and provides extra functionality for sizing that element within its parent and sizing elements contained within it that have a ‘resize’ function attached to them.

To create a Jx.Layout, pass the element or id plus an options object to the constructor.

Example

var myContainer = new Jx.Layout('myDiv', options);

Events

sizeChangefired when the size of the container changes

License

Copyright © 2008, DM Solutions Group Inc.

This file is licensed under an MIT style license

Summary
Create a new instance of Jx.Layout.
when the window is resized, any Jx.Layout controlled elements that are direct children of the BODY element are resized
resize the element controlled by this Jx.Layout object.

Functions

Jx. Layout

Create a new instance of Jx.Layout.

Parameters

domObj{HTMLElement} element or id to apply the layout to
options<Jx.Layout.Options>

windowResize

windowResize: function()

when the window is resized, any Jx.Layout controlled elements that are direct children of the BODY element are resized

resize

resize: function(options)

resize the element controlled by this Jx.Layout object.

Parameters

optionsnew options to apply, see <Jx.Layout.Options>

Jx. Button.Tab

Extends: Jx.Button

Implements: Jx.ContentLoader

A single tab in a tab set.  A tab has a label (displayed in the tab) and a content area that is displayed when the tab is active.  A tab has to be added to both a Jx.TabSet (for the content) and Jx.Toolbar (for the actual tab itself) in order to be useful.  Alternately, you can use a Jx.TabBox which combines both into a single control at the cost of some flexibility in layout options.

A tab is a Jx.ContentLoader and you can specify the initial content of the tab using any of the methods supported by Jx.ContentLoader::loadContent.  You can acccess the actual DOM element that contains the content (if you want to dynamically insert content for instance) via the <Jx.Tab::content> property.

A tab is a button of type toggle which means that it emits the up and down events.

Example

var tab1 = new Jx.Button.Tab({
label: 'tab 1',
content: 'content1',
onDown: function(tab) {
console.log('tab became active');
},
onUp: function(tab) {
console.log('tab became inactive');
}
});

License

Copyright © 2008, DM Solutions Group Inc.

This file is licensed under an MIT style license

Summary
{HTMLElement} The content area that is displayed when the tab is active.
Create a new instance of Jx.Button.Tab.
triggered when the user clicks the button, processes the actionPerformed event

Properties

content

{HTMLElement} The content area that is displayed when the tab is active.

Functions

Jx. Button.Tab

Create a new instance of Jx.Button.Tab.  Any layout options passed are used to create a Jx.Layout for the tab content area.

Parameters

options{Object} an object containing options that are used to control the appearance of the tab.  See Jx.Button, Jx.ContentLoader::loadContent and Jx.Layout::Jx.Layout for valid options.

clicked

clicked : function(evt)

triggered when the user clicks the button, processes the actionPerformed event

Jx. ColorPalette

Extends: Object

Implements: Options, Events, Jx.Addable

A Jx.ColorPalette presents a user interface for selecting colors.  Currently, the user can either enter a HEX colour value or select from a palette of web-safe colours.  The user can also enter an opacity value.

A Jx.ColorPalette can be embedded anywhere in a web page using its addTo method.  However, a Jx.Button subclass is provided (Jx.Button.Color) that embeds a colour panel inside a button for easy use in toolbars.

Colour changes are propogated via a change event.  To be notified of changes in a Jx.ColorPalette, use the addEvent method.

Example

Events

changetriggered when the color changes.
clickthe user clicked on a color swatch (emitted after a change event)

License

Copyright © 2008, DM Solutions Group Inc.

This file is licensed under an MIT style license

Summary
the HTML element representing the color panel
initialize a new instance of Jx.ColorPalette
handle the mouse moving over a colour swatch by updating the preview
handle mouse click on a swatch by updating the color and hiding the panel.
handle the user entering a new colour value manually by updating the selected colour if the entered value is valid HEX.
handle the user entering a new alpha value manually by updating the selected alpha if the entered value is valid alpha (0-100).
set the colour represented by this colour panel
set the alpha represented by this colour panel
update the colour panel user interface based on the current colour and alpha values

Properties

{HTMLElement} domObj

the HTML element representing the color panel

Functions

Jx. ColorPalette

initialize a new instance of Jx.ColorPalette

Parameters

options<Jx.ColorPalette.Options>

swatchOver

swatchOver: function(e)

handle the mouse moving over a colour swatch by updating the preview

Parameters

e{Event} the mousemove event object

swatchClick

swatchClick: function(e)

handle mouse click on a swatch by updating the color and hiding the panel.

Parameters

e{Event} the mouseclick event object

changed

changed: function()

handle the user entering a new colour value manually by updating the selected colour if the entered value is valid HEX.

alphaChanged

alphaChanged: function()

handle the user entering a new alpha value manually by updating the selected alpha if the entered value is valid alpha (0-100).

setColor

setColor: function(color)

set the colour represented by this colour panel

Parameters

color{String} the new hex color value

setAlpha

setAlpha: function(alpha)

set the alpha represented by this colour panel

Parameters

alpha{Integer} the new alpha value (between 0 and 100)

updateSelected

updateSelected: function()

update the colour panel user interface based on the current colour and alpha values

Jx. Button. Color

Extends: Jx.Button.Flyout

A Jx.ColorPalette wrapped up in a Jx.Button.  The button includes a preview of the currently selected color.  Clicking the button opens the color panel.

A color button is essentially a Jx.Button.Flyout where the content of the flyout is a Jx.ColorPalette.  For performance, all color buttons share an instance of Jx.ColorPalette which means only one button can be open at a time.  This isn’t a huge restriction as flyouts already close each other when opened.

Example

var colorButton = new Jx.Button.Color({
onChange: function(button) {
console.log('color:' + button.options.color + ' alpha: ' +
button.options.alpha);
}
});

Events

changefired when the color is changed.

License

Copyright © 2008, DM Solutions Group Inc.

This file is licensed under an MIT style license

Summary
initialize a new color button.
override Jx.Button.Flyout to use a singleton color palette.
hide the color panel
set the color represented by this color panel
set the alpha represented by this color panel
handle the color changing in the palette by updating the preview swatch in the button and firing the change event.
Update the swatch color for the current color

Functions

Jx. Button. Color

initialize a new color button.

Parameters

options<Jx.Button.Color.Options> initialize instance options.

clicked

clicked: function()

override Jx.Button.Flyout to use a singleton color palette.

hide

hide: function()

hide the color panel

setColor

setColor: function(color)

set the color represented by this color panel

Parameters

color{String} the new hex color value

setAlpha

setAlpha: function(alpha)

set the alpha represented by this color panel

Parameters

alpha{Integer} the new alpha value (between 0 and 100)

changed

changed: function(panel)

handle the color changing in the palette by updating the preview swatch in the button and firing the change event.

Parameters

panelJx.ColorPalette the palette that changed.

updateSwatch

updateSwatch: function()

Update the swatch color for the current color

Jx.Menu

Extends: Object

Implements: Options, Events, Jx.AutoPosition, Jx.Chrome, Jx.Addable

A main menu as opposed to a sub menu that lives inside the menu.

TODO: Jx.Menu revisit this to see if Jx.Menu and Jx.SubMenu can be merged into a single implementation.

Example

License

Copyright © 2008, DM Solutions Group Inc.

This file is licensed under an MIT style license

Summary
{HTMLElement} The HTML element containing the menu.
{Jx.Button} The button that represents this menu in a toolbar and opens the menu.
{HTMLElement} the HTML element that contains the menu items within the menu.
{Array} the items in this menu
Create a new instance of Jx.Menu.
Add menu items to the sub menu.
Deactivate the menu by hiding it.
Handle the user moving the mouse over the button for this menu by showing this menu and hiding the other menu.
determine if an event happened inside this menu or a sub menu of this menu.
Hide the menu.
Show the menu
Set the sub menu that is currently open

Properties

domObj

{HTMLElement} The HTML element containing the menu.

button

{Jx.Button} The button that represents this menu in a toolbar and opens the menu.

subDomObj

{HTMLElement} the HTML element that contains the menu items within the menu.

items

{Array} the items in this menu

Functions

Jx.Menu

Create a new instance of Jx.Menu.

Parameters

optionssee <Jx.Button.Options>.  If no options are provided then no button is created.

add

add : function()

Add menu items to the sub menu.

Parameters

item{<Jx.MenuItem>} the menu item to add.  Multiple menu items can be added by passing multiple arguments to this function.

deactivate

deactivate: function()

Deactivate the menu by hiding it.

onMouseOver

onMouseOver: function(e)

Handle the user moving the mouse over the button for this menu by showing this menu and hiding the other menu.

Parameters

e{Event} the mouse event

eventInMenu

eventInMenu: function(e)

determine if an event happened inside this menu or a sub menu of this menu.

Parameters

e{Event} the mouse event

Returns

{Boolean} true if the event happened in the menu or a sub menu of this menu, false otherwise

hide

hide: function(e)

Hide the menu.

Parameters

e{Event} the mouse event

show

show : function(o)

Show the menu

Parameters

e{Event} the mouse event

setVisibleItem

setVisibleItem: function(obj)

Set the sub menu that is currently open

Parameters

obj- {<Jx.SubMenu>} the sub menu that just became visible

Jx. ButtonSet

Extends: Object

Implements: Options, Events

A ButtonSet manages a set of Jx.Button instances by ensuring that only one of the buttons is active.  All the buttons need to have been created with the toggle option set to true for this to work.

Example

var toolbar = new Jx.Toolbar('bar');
var buttonSet = new Jx.ButtonSet();

var tab1 = new Jx.Button({label: 'b1', toggle:true, contentID: 'content1'});
var tab2 = new Jx.Button({label: 'b2', toggle:true, contentID: 'content2'});
var tab3 = new Jx.Button({label: 'b3', toggle:true, contentID: 'content3'});
var tab4 = new Jx.Button({label: 'b4', toggle:true, contentURL: 'test_content.html'});

buttonSet.add(b1,b2,b3,b4);

Events

changethe current button has changed

License

Copyright © 2008, DM Solutions Group Inc.

This file is licensed under an MIT style license

Summary
{Array} array of buttons that are managed by this button set
Create a new instance of Jx.ButtonSet
Add one or more Jx.Buttons to the ButtonSet.
Remove a button from this Button.
Set the active button to the one passed to this method
Handle selection changing on the buttons themselves and activate the appropriate button in response.

Properties

buttons

{Array} array of buttons that are managed by this button set

Functions

Jx. ButtonSet

Create a new instance of Jx.ButtonSet

Parameters

optionsan options object, only event handlers are supported as options at this time.

add

add : function()

Add one or more Jx.Buttons to the ButtonSet.

Parameters

button{Jx.Button} an instance of Jx.Button to add to the button set.  More than one button can be added by passing extra parameters to this method.

remove

remove : function(button)

Remove a button from this Button.

Parameters

button{Jx.Button} the button to remove.

setActiveButton

setActiveButton: function(button)

Set the active button to the one passed to this method

Parameters

button{Jx.Button} the button to make active.

selectionChanged

Handle selection changing on the buttons themselves and activate the appropriate button in response.

Parameters

button{Jx.Button} the button to make active.

Jx. Button. Multi

Extends: Jx.Button

Implements

Multi buttons are used to contain multiple buttons in a drop down list where only one button is actually visible and clickable in the interface.

When the user clicks the active button, it performs its normal action.  The user may also click a drop-down arrow to the right of the button and access the full list of buttons.  Clicking a button in the list causes that button to replace the active button in the toolbar and performs the button’s regular action.

Other buttons can be added to the Multi button using the add method.

This is not really a button, but rather a container for buttons.  The button structure is a div containing two buttons, a normal button and a flyout button.  The flyout contains a toolbar into which all the added buttons are placed.  The main button content is cloned from the last button clicked (or first button added).

The Multi button does not trigger any events itself, only the contained buttons trigger events.

Example

var b1 = new Jx.Button({
label: 'b1',
onClick: function(button) {
console.log('b1 clicked');
}
});
var b2 = new Jx.Button({
label: 'b2',
onClick: function(button) {
console.log('b2 clicked');
}
});
var b3 = new Jx.Button({
label: 'b3',
onClick: function(button) {
console.log('b3 clicked');
}
});
var multiButton = new Jx.Button.Multi();
multiButton.add(b1, b2, b3);

License

Copyright © 2008, DM Solutions Group Inc.

This file is licensed under an MIT style license

Summary
the currently selected button
{Array} the buttons added to this multi button
construct a new instance of Jx.Button.Multi.
adds one or more buttons to the Multi button.
remove a button from a multi button
update the menu item to be the requested button.
update the active button in the menu item, trigger the button’s action and hide the flyout that contains the buttons.

Properties

{<Jx. Button>} activeButton

the currently selected button

buttons

{Array} the buttons added to this multi button

Functions

Jx. Button. Multi

construct a new instance of Jx.Button.Multi.

add

add: function()

adds one or more buttons to the Multi button.  The first button added becomes the active button initialize.  This function takes a variable number of arguments, each of which is expected to be an instance of Jx.Button.

Parameters

button{Jx.Button} a Jx.Button instance, may be repeated in the parameter list

remove

remove: function(button)

remove a button from a multi button

Parameters

button{Jx.Button} the button to remove

setActiveButton

setActiveButton: function(button)

update the menu item to be the requested button.

Parameters

button{Jx.Button} a Jx.Button instance that was added to this multi button.

setButton

setButton: function(button)

update the active button in the menu item, trigger the button’s action and hide the flyout that contains the buttons.

Parameters

button{Jx.Button} The button to set as the active button

Jx. Menu.Item

Extends: Jx.Button

A menu item is a single entry in a menu.  It is typically composed of a label and an optional icon.  Selecting the menu item emits an event.

Jx.Menu.Item is represented by a Jx.Button with type MenuItem and the associated CSS changes noted in Jx.Button.  The container of a MenuItem is an ‘li’ element.

Example

Events

clickfired when the menu item is clicked.

License

Copyright © 2008, DM Solutions Group Inc.

This file is licensed under an MIT style license

Summary
{<Jx.SubMenu> or Jx.Menu} the menu that contains the menu item.
Create a new instance of Jx.Menu.Item
Set the owner of this menu item
Hide the menu item.
Show the menu item
Handle the user clicking on the menu item, overriding the Jx.Button::clicked method to facilitate menu tracking
handle the mouse moving over the menu item

Properties

owner

{<Jx.SubMenu> or Jx.Menu} the menu that contains the menu item.

Functions

Jx. Menu.Item

Create a new instance of Jx.Menu.Item

Parameters

optionsSee <Jx.Button.Options>

setOwner

setOwner: function(obj)

Set the owner of this menu item

Parameters

obj{Object} the new owner

hide

hide: function()

Hide the menu item.

show

Show the menu item

clicked

clicked: function(obj)

Handle the user clicking on the menu item, overriding the Jx.Button::clicked method to facilitate menu tracking

Parameters

obj{Object} an object containing an event property that was the user event.

onmouseover

handle the mouse moving over the menu item

Parameters

e{Event} the mousemove event

Jx. Button. Combo

Extends: Jx.Button.Multi

A drop down list of selectable items.  Items can be either a string, an image or both.

Example

new Jx.Button.Combo({
label: 'Choose a symbol',
items: [
{label: 'Star', image: 'images/swatches.png', imageClass: 'comboStar'},
{label: 'Square', image: 'images/swatches.png', imageClass: 'comboSquare'},
{label: 'Triangle', image: 'images/swatches.png', imageClass: 'comboTriangle'},
{label: 'Circle', image: 'images/swatches.png', imageClass: 'comboCircle'},
{label: 'Plus', image: 'images/swatches.png', imageClass: 'comboPlus'},
{label: 'Cross', image: 'images/swatches.png', imageClass: 'comboCross'}
],
onChange: function(combo) { alert('you selected ' + combo.getValue()) }
})

Events

changetriggered when the user selects a new item from the list

License

Copyright © 2008, DM Solutions Group Inc.

This file is licensed under an MIT style license

Summary
{Object} current selection in the list
create a new instance of Jx.Combo
enable or disable the combo button.
invoked when the current value is changed
Handle the user pressing a key by looking for an ENTER key to set the value.
add a new item to the pick list
Remove the item at the given index.
set the value of the Combo
Return the current value

Properties

currentSelection

{Object} current selection in the list

Functions

Jx. Combo

create a new instance of Jx.Combo

Parameters

options<Jx.button.Combo.Options>

setEnabled

setEnabled: function(enabled)

enable or disable the combo button.

Parameters

enabled{Boolean} the new enabled state of the button

valueChanged

valueChanged: function()

invoked when the current value is changed

onKeyPress

onKeyPress: function(e)

Handle the user pressing a key by looking for an ENTER key to set the value.

Parameters

e{Event} the keypress event

add

add: function()

add a new item to the pick list

Parameters

options{Object} object with properties suitable to be passed to a <Jx.Menu.Item.Options> object.  More than one options object can be passed, comma separated or in an array.

remove

remove: function(idx)

Remove the item at the given index.  Not implemented.

Parameters

idx{Integer} the item to remove.

setValue

setValue: function(value)

set the value of the Combo

Parameters

value{Object} the new value.  May be a string, a text node, or another DOM element.

getValue

getValue: function()

Return the current value

Returns

{Object} returns the currently selected item

Jx. Panel

Extends: Object

Implements: Options, Events, Jx.ContentLoader

A panel is a fundamental container object that has a content area and optional toolbars around the content area.  It also has a title bar area that contains an optional label and some user controls as determined by the options passed to the constructor.

Example

Events

closefired when the panel is closed
collapsefired when the panel is collapsed
expandfired when the panel is opened

License

Copyright © 2008, DM Solutions Group Inc.

This file is licensed under an MIT style license

Summary
Initialize a new Jx.Panel instance
the sizeChange event of the Jx.Layout that manages the outer container is intercepted and passed through this method to handle resizing of the panel contents because we need to do some calculations if the panel is collapsed and if there are toolbars to put around the content area.
Set the label in the title bar of this panel
Get the label of the title bar of this panel
Clean up the panel
Maximize this panel
set the content of this panel to some HTML
Set the content of this panel to come from some URL.
When the content of the panel is loaded from a remote URL, this method is called when the ajax request returns.
Set the panel as busy or not busy, which displays a loading image in the title bar.
sets or toggles the collapsed state of the panel.
Closes the panel (completely hiding it).

Functions

Jx. Panel

Initialize a new Jx.Panel instance

Options: <Jx.Panel.Options>, <Jx.ContentLoader.Options>

layoutContent

layoutContent: function()

the sizeChange event of the Jx.Layout that manages the outer container is intercepted and passed through this method to handle resizing of the panel contents because we need to do some calculations if the panel is collapsed and if there are toolbars to put around the content area.

setLabel

setLabel: function(s)

Set the label in the title bar of this panel

Parameters

s{String} the new label

getLabel

getLabel: function()

Get the label of the title bar of this panel

Returns

{String} the label

finalize

finalize: function()

Clean up the panel

maximize

maximize: function()

Maximize this panel

setContent

setContent : function (html)

set the content of this panel to some HTML

Parameters

html{String} the new HTML to go in the panel

setContentURL

setContentURL : function (url)

Set the content of this panel to come from some URL.

Parameters

url{String} URL to some HTML content for this panel

panelContentLoaded

panelContentLoaded: function(html)

When the content of the panel is loaded from a remote URL, this method is called when the ajax request returns.

Parameters

html{String} the html return from xhr.onSuccess

setBusy

setBusy : function(isBusy)

Set the panel as busy or not busy, which displays a loading image in the title bar.

Parameters

isBusy{Boolean} the busy state

toggleCollapse

toggleCollapse: function(state)

sets or toggles the collapsed state of the panel.  If a new state is passed, it is used, otherwise the current state is toggled.

Parameters

stateoptional, if passed then the state is used, otherwise the state is toggled.

close

close: function()

Closes the panel (completely hiding it).

Jx. Dialog

Extends: Jx.Panel

Implements: Jx.AutoPosition, Jx.Chrome

A Jx.Dialog implements a floating dialog.  Dialogs represent a useful way to present users with certain information or application controls.  Jx.Dialog is designed to provide the same types of features as traditional operating system dialog boxes, including:

  • dialogs may be modal (user must dismiss the dialog to continue) or non-modal
  • dialogs are movable (user can drag the title bar to move the dialog around)
  • dialogs may be a fixed size or allow user resizing.

Jx.Dialog uses Jx.ContentLoader to load content into the content area of the dialog.  Refer to the Jx.ContentLoader documentation for details on content options.

Example

var dialog = new Jx.Dialog();

Events

opentriggered when the dialog is opened
closetriggered when the dialog is closed
changetriggered when the value of an input in the dialog is changed
resizetriggered when the dialog is resized

Extends

Jx.Dialog extends Jx.Panel, please go there for more details.

License

Copyright © 2008, DM Solutions Group Inc.

This file is licensed under an MIT style license

Summary
modal dialogs prevent interaction with the rest of the application while they are open, this element is displayed just under the dialog to prevent the user from clicking anything.
Construct a new instance of Jx.Dialog
resize the dialog.
overload panel’s sizeChanged method
sets or toggles the collapsed state of the panel.
show the dialog, external code should use the Jx.Dialog::open method to make the dialog visible.
hide the dialog, external code should use the Jx.Dialog::close method to hide the dialog.
open the dialog and load content from the provided url.
open the dialog.
close the dialog and trigger the onClose callback function if necessary

Properties

{HTMLElement} blanket

modal dialogs prevent interaction with the rest of the application while they are open, this element is displayed just under the dialog to prevent the user from clicking anything.

Functions

Jx. Dialog

Construct a new instance of Jx.Dialog

Parameters

options{Object} an object containing options for the dialog.

Options: <Jx.Dialog.Options>, <Jx.Panel.Options>, <Jx.ContentLoader.Options>

resize

resize: function(width,
height,
autoPosition)

resize the dialog.  This can be called when the dialog is closed or open.

Parameters

widththe new width
heightthe new height
autoPositionboolean, false by default, if resizing an open dialog setting this to true will reposition it according to its position rules.

sizeChanged

sizeChanged: function()

overload panel’s sizeChanged method

toggleCollapse

toggleCollapse: function(state)

sets or toggles the collapsed state of the panel.  If a new state is passed, it is used, otherwise the current state is toggled.

Parameters

stateoptional, if passed then the state is used, otherwise the state is toggled.

show

show : function( )

show the dialog, external code should use the Jx.Dialog::open method to make the dialog visible.

hide

hide : function()

hide the dialog, external code should use the Jx.Dialog::close method to hide the dialog.

openURL

openURL: function(url)

open the dialog and load content from the provided url.  If you don’t provide a URL then the dialog opens normally.

Parameters

url<String> the url to load when opening.

open

open: function()

open the dialog.  This may be delayed depending on the asynchronous loading of dialog content.  The onOpen callback function is called when the dialog actually opens

close

close: function()

close the dialog and trigger the onClose callback function if necessary

Jx. Splitter

Extends: Object

Implements: Options

a Jx.Splitter creates two or more containers within a parent container and provides user control over the size of the containers.  The split can be made horizontally or vertically.

A horizontal split creates containers that divide the space horizontally with vertical bars between the containers.  A vertical split divides the space vertically and creates horizontal bars between the containers.

Example

License

Copyright © 2008, DM Solutions Group Inc.

This file is licensed under an MIT style license

Summary
{HTMLElement} the element being split
{Array} an array of elements that are displayed in each of the split areas
{Array} an array of the bars between each of the elements used to resize the split areas.
{Boolean} track the first resize event so that unexposed Jx things can be forced to calculate their size the first time they are exposed.
Create a new instance of Jx.Splitter
Prepare a new, empty element to go into a split area.
Prepare a new, empty bar to go into between split areas.
Setup the initial set of constraints that set the behaviour of the bars between the elements in the split area.
In a horizontally split container, handle a bar being dragged left or right by resizing the elements on either side of the bar.
In a vertically split container, handle a bar being dragged up or down by resizing the elements on either side of the bar.
handle the size of the container being changed.
Resize a horizontally layed-out container
Resize a vertically layed out container.

Properties

domObj

{HTMLElement} the element being split

elements

{Array} an array of elements that are displayed in each of the split areas

bars

{Array} an array of the bars between each of the elements used to resize the split areas.

firstUpdate

{Boolean} track the first resize event so that unexposed Jx things can be forced to calculate their size the first time they are exposed.

Functions

Jx. Splitter

Create a new instance of Jx.Splitter

Parameters

domObj{HTMLElement} the element or id of the element to split
options<Jx.Splitter.Options>

prepareElement

prepareElement: function()

Prepare a new, empty element to go into a split area.

Returns

{HTMLElement} an HTMLElement that goes into a split area.

prepareBar

prepareBar: function()

Prepare a new, empty bar to go into between split areas.

Returns

{HTMLElement} an HTMLElement that becomes a bar.

establishConstraints

establishConstraints: function()

Setup the initial set of constraints that set the behaviour of the bars between the elements in the split area.

dragHorizontal

dragHorizontal: function(obj)

In a horizontally split container, handle a bar being dragged left or right by resizing the elements on either side of the bar.

Parameters

obj{HTMLElement} the bar that was dragged

dragVertical

dragVertical: function(obj)

In a vertically split container, handle a bar being dragged up or down by resizing the elements on either side of the bar.

Parameters

obj{HTMLElement} the bar that was dragged

sizeChanged

sizeChanged: function()

handle the size of the container being changed.

horizontalResize

horizontalResize: function()

Resize a horizontally layed-out container

verticalResize

verticalResize: function()

Resize a vertically layed out container.

Jx. PanelSet

Extends: Object

Implements: Options, Events, Jx.Addable

A panel set manages a set of panels within a DOM element.  The PanelSet fills its container by resizing the panels in the set to fill the width and then distributing the height of the container across all the panels.  Panels can be resized by dragging their respective title bars to make them taller or shorter.  The maximize button on the panel title will cause all other panels to be closed and the target panel to be expanded to fill the remaining space.  In this respect, PanelSet works like a traditional Accordion control.

When creating panels for use within a panel set, it is important to use the proper options.  You must override the collapse option and set it to false and add a maximize option set to true.  You must also not include options for menu and close.

Example

var p1 = new Jx.Panel({collapse: false, maximize: true, content: 'content1'});
var p2 = new Jx.Panel({collapse: false, maximize: true, content: 'content2'});
var p3 = new Jx.Panel({collapse: false, maximize: true, content: 'content3'});
var panelSet = new Jx.PanelSet('panels', [p1,p2,p3]);

License

Copyright © 2008, DM Solutions Group Inc.

This file is licensed under an MIT style license

Summary
{Array} the panels being managed by the set
{Integer} the height of the container, cached for speed
{Boolean} true until the panel set has first been resized
Create a new instance of Jx.PanelSet.
Maximize a panel, taking up all available space (taking into consideration any minimum or maximum values)

Properties

panels

{Array} the panels being managed by the set

height

{Integer} the height of the container, cached for speed

firstLayout

{Boolean} true until the panel set has first been resized

Functions

Jx. PanelSet

Create a new instance of Jx.PanelSet.

Parameters

options<Jx.PanelSet.Options>

TODO: Jx.PanelSet.initialize Remove the panels parameter in favour of an add method.

maximizePanel

maximizePanel: function(panel)

Maximize a panel, taking up all available space (taking into consideration any minimum or maximum values)

Jx.Grid

Extends: Object

Implements: Options, Events, Jx.Addable

A tabular control that has fixed scrolling headers on the rows and columns like a spreadsheet.

Jx.Grid is a tabular control with convenient controls for resizing columns, sorting, and inline editing.  It is created inside another element, typically a div.  If the div is resizable (for instance it fills the page or there is a user control allowing it to be resized), you must call the resize() method of the grid to let it know that its container has been resized.

When creating a new Jx.Grid, you can specify a number of options for the grid that control its appearance and functionality.

Jx.Grid renders data that comes from an external source.  This external source, called the model, must implement the following interface.

Example

License

Copyright © 2008, DM Solutions Group Inc.

This file is licensed under an MIT style license

Summary
construct a new instance of Jx.Grid within the domObj
handle the grid scrolling by updating the position of the headers
resize the grid to fit inside its container.
set the model for the grid to display.
destroy the contents of the grid safely
create the grid for the current model
set the height of a row.
called through the grid listener interface when data has changed in the underlying model
apply the jxGridRowHeaderPrelight style to the header cell of a row.
apply the jxGridColumnHeaderPrelight style to the header cell of a column.
apply the jxGridRowPrelight style to row.
apply the jxGridColumnPrelight style to a column.
apply the jxGridCellPrelight style to a cell.
Select a cell and apply the jxGridCellSelected style to it.
Apply the jxGridRowHeaderSelected style to the row header cell of a selected row.
Select a row and apply the jxGridRowSelected style to it.
Apply the jxGridColumnHeaderSelected style to the column header cell of a selected column.
Select a column.
handle the mouse moving over the main grid.
handle the mouse moving over the row header cells.
handle the mouse moving over the column header cells.
handle the user clicking on the grid.
handle the user clicking on the row header.
handle the user clicking on the column header.
retrieve the row and column indexes from an event click.
create a new grid model
This function returns the number of columns of data in the model as an integer value.
This function returns an HTML string to be placed in the column header for the given column index.
This function returns an integer which is the height of the column header row in pixels.
This function returns an integer which is the width of the given column in pixels.
This function returns an HTML string to be placed in the row header for the given row index
This function returns an integer which is the width of the row header column in pixels.
This function returns an integer which is the height of the given row in pixels.
This function returns the number of rows of data in the model as an integer value.
This function returns an HTML string which is the text to place in the cell at the given row and column.
This function is called with a column index and width in pixels when a column is resized.
This function returns a boolean value to indicate if a given cell is editable by the user.
This function is called with the row and column of a cell and a new value for the cell.
This function is called by the grid to indicate that the user has selected a row by clicking on the row header.
This function is called by the grid to indicate that the user has selected a column by clicking on the column header.
This function is called by the grid to indicate that the user has selected a cell by clicking on the cell in the grid.

Functions

Jx.Grid

construct a new instance of Jx.Grid within the domObj

Parameters

options<Jx.Grid.Options>

onScroll

onScroll: function()

handle the grid scrolling by updating the position of the headers

resize

resize: function()

resize the grid to fit inside its container.  This involves knowing something about the model it is displaying (the height of the column header and the width of the row header) so nothing happens if no model is set

setModel

setModel: function(model)

set the model for the grid to display.  If a model is attached to the grid it is removed and the new model is displayed.

Parameters

model{Object} the model to use for this grid

destroyGrid

destroyGrid: function()

destroy the contents of the grid safely

createGrid

createGrid: function()

create the grid for the current model

setRowHeaderHeight

setRowHeaderHeight: function(row,
height)

set the height of a row.  This is used internally to adjust the height of the row header when cell contents wrap.  A limitation of the table structure is that overflow: hidden on a td will work horizontally but not vertically

Parameters

row{Integer} the row to set the height for
height{Integer} the height to set the row (in pixels)

gridChanged

gridChanged: function(model,
row,
col,
value)

called through the grid listener interface when data has changed in the underlying model

Parameters

model{Object} the model that changed
row{Integer} the row that changed
col{Integer} the column that changed
value{Mixed} the new value

prelightRowHeader

prelightRowHeader: function(row)

apply the jxGridRowHeaderPrelight style to the header cell of a row.  This removes the style from the previously pre-lit row header.

Parameters

row{Integer} the row to pre-light the header cell of

prelightColumnHeader

prelightColumnHeader: function(col)

apply the jxGridColumnHeaderPrelight style to the header cell of a column.  This removes the style from the previously pre-lit column header.

Parameters

col{Integer} the column to pre-light the header cell of

prelightRow

prelightRow: function(row)

apply the jxGridRowPrelight style to row.  This removes the style from the previously pre-lit row.

Parameters

row{Integer} the row to pre-light

prelightColumn

prelightColumn: function(col)

apply the jxGridColumnPrelight style to a column.  This removes the style from the previously pre-lit column.

Parameters

col{Integer} the column to pre-light

TODO: Jx.Grid.prelightColumn Not Yet Implemented.

prelightCell

prelightCell: function(row,
col)

apply the jxGridCellPrelight style to a cell.  This removes the style from the previously pre-lit cell.

Parameters

row{Integer} the row of the cell to pre-light
col{Integer} the column of the cell to pre-light

selectCell

selectCell: function(row,
col)

Select a cell and apply the jxGridCellSelected style to it.  This deselects a previously selected cell.

If the model supports cell selection, it should implement a cellSelected function to receive notification of the selection.

Parameters

row{Integer} the row of the cell to select
col{Integer} the column of the cell to select

selectRowHeader

selectRowHeader: function(row,
selected)

Apply the jxGridRowHeaderSelected style to the row header cell of a selected row.

Parameters

row{Integer} the row header to select
selected{Boolean} the new state of the row header

selectRow

selectRow: function(row,
selected)

Select a row and apply the jxGridRowSelected style to it.

If the model supports row selection, it should implement a rowSelected function to receive notification of the selection.

Parameters

row{Integer} the row to select
selected{Boolean} the new state of the row

selectColumnHeader

selectColumnHeader: function(col,
selected)

Apply the jxGridColumnHeaderSelected style to the column header cell of a selected column.

Parameters

col{Integer} the column header to select
selected{Boolean} the new state of the column header

selectColumn

selectColumn: function(col,
selected)

Select a column.  This deselects a previously selected column.

Parameters

col{Integer} the column to select
selected{Boolean} the new state of the column

onMouseMoveGrid

onMouseMoveGrid: function(e)

handle the mouse moving over the main grid.  This pre-lights the cell, and subsquently the row and column (and headers).

Parameters

e{Event} the browser event object

onMouseMoveRowHeader

onMouseMoveRowHeader: function(e)

handle the mouse moving over the row header cells.  This pre-lights the row and subsequently the row header.

Parameters

e{Event} the browser event object

onMouseMoveColumnHeader

onMouseMoveColumnHeader: function(e)

handle the mouse moving over the column header cells.  This pre-lights the column and subsequently the column header.

Parameters

e{Event} the browser event object

onClickGrid

onClickGrid: function(e)

handle the user clicking on the grid.  This triggers an event to the model (if a cellSelected function is provided).

The following is an example of a function in the model that selects a row when the cellSelected function is called and deselects any rows that are currently selected.

cellSelected: function(grid, row,col) {
if (this.selectedRow != null) {
grid.selectRow(this.selectedRow, false);
}
this.selectedRow = row;
grid.selectRow(row, true);
}

Parameters:
e - {Event} the browser event object

onClickRowHeader

onClickRowHeader: function(e)

handle the user clicking on the row header.  This triggers an event to the model (if a rowSelected function is provided) which can then select the row if desired.

The following is an example of a function in the model that selects a row when the rowSelected function is called and deselects any rows that are currently selected.  More complex code could be written to allow the user to select multiple rows.

rowSelected: function(grid, row) {
if (this.selectedRow != null) {
grid.selectRow(this.selectedRow, false);
}
this.selectedRow = row;
grid.selectRow(row, true);
}

Parameters

e{Event} the browser event object

onClickColumnHeader

onClickColumnHeader: function(e)

handle the user clicking on the column header.  This triggers column selection and column (and header) styling changes and an event to the model (if a columnSelected function is provided)

The following is an example of a function in the model that selects a column when the columnSelected function is called and deselects any columns that are currently selected.  More complex code could be written to allow the user to select multiple columns.

colSelected: function(grid, col) {
if (this.selectedColumn != null) {
grid.selectColumn(this.selectedColumn, false);
}
this.selectedColumn = col;
grid.selectColumn(col, true);
}

Parameters

e{Event} the browser event object

getRowColumnFromEvent

getRowColumnFromEvent: function(e)

retrieve the row and column indexes from an event click.  This function is used by the grid, row header and column header to safely get these numbers.

If the event isn’t valid (i.e. it wasn’t on a TD or TH) then the returned values will be -1, -1

Parameters

e{Event} the browser event object

@return Object an object with two properties, row and column, that contain the row and column that was clicked

Jx. Grid. Model

create a new grid model

Parameters

dataarray of data to display in the grid
options<Jx.Grid.Model.Options>

getColumnCount

getColumnCount: function()

This function returns the number of columns of data in the model as an integer value.

getColumnHeaderHTML

getColumnHeaderHTML: function(col)

This function returns an HTML string to be placed in the column header for the given column index.

getColumnHeaderHeight

getColumnHeaderHeight: function()

This function returns an integer which is the height of the column header row in pixels.

getColumnWidth

getColumnWidth: function(col)

This function returns an integer which is the width of the given column in pixels.

getRowHeaderHTML

getRowHeaderHTML: function(row)

This function returns an HTML string to be placed in the row header for the given row index

getRowHeaderWidth

getRowHeaderWidth: function()

This function returns an integer which is the width of the row header column in pixels.

getRowHeight

getRowHeight: function(row)

This function returns an integer which is the height of the given row in pixels.

getRowCount

getRowCount: function()

This function returns the number of rows of data in the model as an integer value.

getValueAt

getValueAt: function(row,
col)

This function returns an HTML string which is the text to place in the cell at the given row and column.

setColumnWidth

setColumnWidth: function()

This function is called with a column index and width in pixels when a column is resized.  This function is only required if the grid allows resizeable columns.

isCellEditable

isCellEditable: function()

This function returns a boolean value to indicate if a given cell is editable by the user.

setValueAt

setValueAt: function(row,
col,
value)

This function is called with the row and column of a cell and a new value for the cell.  It is mandatory to provide this function if any of the cells in the model are editable.

rowSelected

rowSelected: function(grid,
row)

This function is called by the grid to indicate that the user has selected a row by clicking on the row header.

columnSelected

columnSelected: function(grid,
col)

This function is called by the grid to indicate that the user has selected a column by clicking on the column header.

cellSelected

cellSelected: function(grid,
row,
col)

This function is called by the grid to indicate that the user has selected a cell by clicking on the cell in the grid.

Jx. Menu. Context

Extends: Jx.Menu

A Jx.Menu that has no button but can be opened at a specific browser location to implement context menus (for instance).

Example

Events

TODOadd open/close events?

License

Copyright © 2008, DM Solutions Group Inc.

This file is licensed under an MIT style license

Summary
create a new context menu
Show the context menu at the location of the mouse click

Functions

Jx. ContextMenu

create a new context menu

Parameters

id{HTMLElement} element or id to make this the context menu for.  The menu hooks the oncontextmenu event of the element and shows itself at the mouse position where the right-click happened.

show

show : function(e)

Show the context menu at the location of the mouse click

Parameters

e{Event} the mouse event

Jx. Menu. Separator

Extends: Object

A convenience class to create a visual separator in a menu.

Example

License

Copyright © 2008, DM Solutions Group Inc.

This file is licensed under an MIT style license

Summary
{HTMLElement} the HTML element that the separator is contained within
{Jx.Menu, Jx.Menu.SubMenu} the menu that the separator is in.
Create a new instance of a menu separator
Set the ownder of this menu item
Hide the menu item.
Show the menu item

Properties

domObj

{HTMLElement} the HTML element that the separator is contained within

owner

{Jx.Menu, Jx.Menu.SubMenu} the menu that the separator is in.

Functions

Jx. Menu. Separator

Create a new instance of a menu separator

setOwner

setOwner: function(obj)

Set the ownder of this menu item

Parameters

obj{Object} the new owner

hide

Hide the menu item.

show

Show the menu item

Jx. Menu. SubMenu

Extends: Jx.Menu.Item

Implements: Jx.AutoPosition, Jx.Chrome

A sub menu contains menu items within a main menu or another sub menu.

The structure of a SubMenu is the same as a Jx.Menu.Item with an additional unordered list element appended to the container.

Example

License

Copyright © 2008, DM Solutions Group Inc.

This file is licensed under an MIT style license

Summary
{HTMLElement} the HTML container for the sub menu.
{Jx.Menu or Jx.SubMenu} the menu or sub menu that this sub menu belongs
{<Jx.MenuItem>} the visible item within the menu
{Array} the menu items that are in this sub menu.
Create a new instance of Jx.SubMenu
Set the owner of this sub menu
Show the sub menu
Hide the sub menu
Add menu items to the sub menu.
Insert a menu item before another menu item.
Remove a single menu item from the menu.
Deactivate the sub menu
Indicate if this sub menu is active
Set the active state of the Jx.Menu that contains this sub menu
Set a sub menu of this menu to be visible and hide the previously visible one.

Properties

subDomObj

{HTMLElement} the HTML container for the sub menu.

owner

{Jx.Menu or Jx.SubMenu} the menu or sub menu that this sub menu belongs

visibleItem

{<Jx.MenuItem>} the visible item within the menu

items

{Array} the menu items that are in this sub menu.

Functions

Jx. SubMenu

Create a new instance of Jx.SubMenu

Parameters

optionssee <Jx.Button.Options>

setOwner

setOwner: function(obj)

Set the owner of this sub menu

Parameters

obj{Object} the owner

show

show: function()

Show the sub menu

hide

hide: function()

Hide the sub menu

add

add : function()

Add menu items to the sub menu.

Parameters

item{<Jx.MenuItem>} the menu item to add.  Multiple menu items can be added by passing multiple arguments to this function.

insertBefore

insertBefore: function(newItem,
targetItem)

Insert a menu item before another menu item.

Parameters

newItem{<Jx.MenuItem>} the menu item to insert
targetItem{<Jx.MenuItem>} the menu item to insert before

remove

remove: function(item)

Remove a single menu item from the menu.

Parameters

item{<Jx.MenuItem} the menu item to remove.

deactivate

deactivate: function(e)

Deactivate the sub menu

Parameters

e{Event} the event that triggered the menu being deactivated.

isActive

isActive: function()

Indicate if this sub menu is active

Returns

{Boolean} true if the Jx.Menu that ultimately contains this sub menu is active, false otherwise.

setActive

setActive: function(isActive)

Set the active state of the Jx.Menu that contains this sub menu

Parameters

isActive{Boolean} the new active state

setVisibleItem

setVisibleItem: function(obj)

Set a sub menu of this menu to be visible and hide the previously visible one.

Parameters

obj{Jx.SubMenu} the sub menu that should be visible

Jx. Splitter.Snap

Extends: Object

A helper class to create an element that can snap a split panel open or closed.

Example

License

Copyright © 2008, DM Solutions Group Inc.

This file is licensed under an MIT style license

Summary
{HTMLElement} the DOM element of the snap (the thing that gets clicked).
{HTMLElement} An element of the Jx.Splitter that gets controlled by this snap
{Jx.Splitter} the splitter that this snap is associated with.
{String} track the layout of the splitter for convenience.
Create a new Jx.Splitter.Snap
Snap the element open or closed.
Handle the size of the element changing to see if the toggle state has changed.

Properties

snap

{HTMLElement} the DOM element of the snap (the thing that gets clicked).

element

{HTMLElement} An element of the Jx.Splitter that gets controlled by this snap

splitter

{Jx.Splitter} the splitter that this snap is associated with.

layout

{String} track the layout of the splitter for convenience.

Functions

Jx. Splitter.Snap

Create a new Jx.Splitter.Snap

Parameters

snap{HTMLElement} the clickable thing that snaps the element open and closed
element{HTMLElement} the element that gets controlled by the snap
splitter{Jx.Splitter} the splitter that this all happens inside of.

toggleElement

toggleElement: function()

Snap the element open or closed.

sizeChanged

Handle the size of the element changing to see if the toggle state has changed.

Jx. Toolbar

Extends: Object

Implements: Options, Events

A toolbar is a container object that contains other objects such as buttons.  The toolbar organizes the objects it contains automatically, wrapping them as necessary.  Multiple toolbars may be placed within the same containing object.

Jx.Toolbar includes CSS classes for styling the appearance of a toolbar to be similar to traditional desktop application toolbars.

There is one special object, Jx.ToolbarSeparator, that provides a visual separation between objects in a toolbar.

While a toolbar is generally a dumb container, it serves a special purpose for menus by providing some infrastructure so that menus can behave properly.

In general, almost anything can be placed in a Toolbar, and mixed with anything else.

Example

The following example shows how to create a Jx.Toolbar instance and place two objects in it.

//myToolbarContainer is the id of a <div> in the HTML page.
function myFunction() {}
var myToolbar = new Jx.Toolbar('myToolbarContainer');

var myButton = new Jx.Button(buttonOptions);

var myElement = document.createElement('select');

myToolbar.add(myButton, new Jx.ToolbarSeparator(), myElement);

Events

addfired when one or more buttons are added to a toolbar
removefired when on eor more buttons are removed from a toolbar

Implements

Options

License

Copyright © 2008, DM Solutions Group Inc.

This file is licensed under an MIT style license

Summary
{Array} an array of the things in the toolbar.
{HTMLElement} the HTML element that the toolbar lives in
When a toolbar contains Jx.Menu instances, they want to know if any menu in the toolbar is active and this is how they find out.
Create a new instance of Jx.Toolbar.
add this toolbar to a DOM element automatically creating a toolbar container if necessary
Add an item to the toolbar.
remove an item from a toolbar.
Deactivate the Toolbar (when it is acting as a menu bar).
Indicate if the toolbar is currently active (as a menu bar)
Set the active state of the toolbar (for menus)
For menus, they want to know which menu is currently open.

Properties

items

{Array} an array of the things in the toolbar.

domObj

{HTMLElement} the HTML element that the toolbar lives in

isActive

When a toolbar contains Jx.Menu instances, they want to know if any menu in the toolbar is active and this is how they find out.

Functions

Jx. Toolbar

Create a new instance of Jx.Toolbar.

Parameters

options<Jx.Toolbar.Options>

addTo

addTo: function(parent)

add this toolbar to a DOM element automatically creating a toolbar container if necessary

Parameters

parentthe DOM element or toolbar container to add this toolbar to.

add

add: function( )

Add an item to the toolbar.  If the item being added is a Jx component with a domObj property, the domObj is added.  If the item being added is an LI element, then it is given a CSS class of jxToolItem.  Otherwise, the thing is wrapped in a <Jx.ToolbarItem>.

Parameters

thing{Object} the thing to add.  More than one thing can be added by passing multiple arguments.

remove

remove: function(item)

remove an item from a toolbar.  If the item is not in this toolbar nothing happens

Parameters

item{Object} the object to remove

Returns

{Object} the item that was removed, or null if the item was not removed.

deactivate

deactivate: function()

Deactivate the Toolbar (when it is acting as a menu bar).

isActive

isActive: function()

Indicate if the toolbar is currently active (as a menu bar)

Returns

{Boolean}

setActive

setActive: function(b)

Set the active state of the toolbar (for menus)

Parameters

b{Boolean} the new state

setVisibleItem

setVisibleItem: function(obj)

For menus, they want to know which menu is currently open.

Parameters

obj{Jx.Menu} the menu that just opened.

Jx. TabSet

Extends: Object

Implements: Options, Events

A TabSet manages a set of Jx.Button.Tab content areas by ensuring that only one of the content areas is visible (i.e. the active tab).  TabSet does not manage the actual tabs.  The instances of Jx.Button.Tab that are to be managed as a set have to be added to both a TabSet and a Jx.Toolbar.  The content areas of the Jx.Button.Tabs are sized to fit the content area that the TabSet is managing.

Example

var tabBar = new Jx.Toolbar('tabBar');
var tabSet = new Jx.TabSet('tabArea');

var tab1 = new Jx.Button.Tab('tab 1', {contentID: 'content1'});
var tab2 = new Jx.Button.Tab('tab 2', {contentID: 'content2'});
var tab3 = new Jx.Button.Tab('tab 3', {contentID: 'content3'});
var tab4 = new Jx.Button.Tab('tab 4', {contentURL: 'test_content.html'});

tabSet.add(t1, t2, t3, t4);
tabBar.add(t1, t2, t3, t4);

Events

tabChangethe current tab has changed

License

Copyright © 2008, DM Solutions Group Inc.

This file is licensed under an MIT style license

Summary
{Array} array of tabs that are managed by this tab set
{HTMLElement} The HTML element that represents this tab set in the DOM.
Create a new instance of Jx.TabSet within a specific element of the DOM.
Resize the tab set content area and propogate the changes to each of the tabs managed by the tab set.
Add one or more Jx.Button.Tabs to the TabSet.
Remove a tab from this TabSet.
Set the active tab to the one passed to this method

Properties

tabs

{Array} array of tabs that are managed by this tab set

domObj

{HTMLElement} The HTML element that represents this tab set in the DOM.  The content areas of each tab are sized to fill the domObj.

Functions

Jx. TabSet

Create a new instance of Jx.TabSet within a specific element of the DOM.

Parameters

domObj{HTMLElement} an element or id of an element to put the content of the tabs into.
optionsan options object, only event handlers are supported as options at this time.

resizeTabBox

resizeTabBox: function()

Resize the tab set content area and propogate the changes to each of the tabs managed by the tab set.

add

add: function()

Add one or more Jx.Button.Tabs to the TabSet.

Parameters

tab{<Jx.Tab>} an instance of <Jx.Tab> to add to the tab set.  More than one tab can be added by passing extra parameters to this method.

remove

remove: function(tab)

Remove a tab from this TabSet.  Note that it is the caller’s responsibility to remove the tab from the Jx.Toolbar.

Parameters

tab{<Jx.Tab>} the tab to remove.

setActiveTab

setActiveTab: function(tab)

Set the active tab to the one passed to this method

Parameters

tab{Jx.Button.Tab} the tab to make active.

Jx. TabBox

Extends: Object

Implements: Options, Events, Jx.Addable

A convenience class to handle the common case of a single toolbar directly attached to the content area of the tabs.  It manages both a Jx.Toolbar and a Jx.TabSet so that you don’t have to.  If you are using a TabBox, then tabs only have to be added to the TabBox rather than to both a Jx.TabSet and a Jx.Toolbar.

Example

var tabBox = new Jx.TabBox('subTabArea', 'top');

var tab1 = new Jx.Button.Tab('Tab 1', {contentID: 'content4'});
var tab2 = new Jx.Button.Tab('Tab 2', {contentID: 'content5'});

tabBox.add(tab1, tab2);

License

Copyright © 2008, DM Solutions Group Inc.

This file is licensed under an MIT style license

Summary
{Jx.Toolbar} the toolbar for this tab box.
{Jx.TabSet} the tab set for this tab box.
Create a new instance of a TabBox.
Add one or more <Jx.Tab>s to the TabBox.
Remove a tab from the TabSet.

Properties

tabBar

{Jx.Toolbar} the toolbar for this tab box.

tabSet

{Jx.TabSet} the tab set for this tab box.

Functions

Jx. TabBox

Create a new instance of a TabBox.

Parameters

options<Jx.TabBox.Options>

add

add : function()

Add one or more <Jx.Tab>s to the TabBox.

Parameters

tab{<Jx.Tab>} an instance of <Jx.Tab> to add to the tab box.  More than one tab can be added by passing extra parameters to this method.  Unlike Jx.TabSet, tabs do not have to be added to a separate Jx.Toolbar.

remove

remove : function(tab)

Remove a tab from the TabSet.

Parameters

tab{<Jx.Tab>} the tab to remove.

Jx. Toolbar. Container

Extends: Object

Implements: Options, Events, Jx.Addable

A toolbar container contains toolbars.  A single toolbar container fills the available space horizontally.  Toolbars placed in a toolbar container do not wrap when they exceed the available space.

Events

addfired when one or more toolbars are added to a container
removefired when one or more toolbars are removed from a container

Implements

Options Events {Jx.Addable}

License

Copyright © 2008, DM Solutions Group Inc.

This file is licensed under an MIT style license

Summary
{HTMLElement} the HTML element that the container lives in
Create a new instance of Jx.Toolbar.Container
Add a toolbar to the container.
remove an item from a toolbar.
scrolls an item in one of the toolbars into the currently visible area of the container if it is not already fully visible

Properties

domObj

{HTMLElement} the HTML element that the container lives in

Functions

Jx. Toolbar. Container

Create a new instance of Jx.Toolbar.Container

Parameters

options<Jx.Toolbar.Options>

add

add: function( )

Add a toolbar to the container.

Parameters

toolbar{Object} the toolbar to add.  More than one toolbar can be added by passing multiple arguments.

remove

remove: function(item)

remove an item from a toolbar.  If the item is not in this toolbar nothing happens

Parameters

item{Object} the object to remove

Returns

{Object} the item that was removed, or null if the item was not removed.

scrollIntoView

scrollIntoView: function(item)

scrolls an item in one of the toolbars into the currently visible area of the container if it is not already fully visible

Parameters

itemthe item to scroll.

Jx. Toolbar.Item

Extends: Object

Implements: Options

A helper class to provide a container for something to go into a Jx.Toolbar.

License

Copyright © 2008, DM Solutions Group Inc.

This file is licensed under an MIT style license

Summary
{HTMLElement} an element to contain the thing to be placed in the toolbar.
Create a new instance of Jx.Toolbar.Item.

Properties

domObj

{HTMLElement} an element to contain the thing to be placed in the toolbar.

Functions

Jx. Toolbar.Item

Create a new instance of Jx.Toolbar.Item.

Parameters

jxThing{Object} the thing to be contained.

Jx. Toolbar. Separator

Extends: Object

A helper class that represents a visual separator in a Jx.Toolbar

Example

License

Copyright © 2008, DM Solutions Group Inc.

This file is licensed under an MIT style license

Summary
{HTMLElement} The DOM element that goes in the Jx.Toolbar
Create a new Jx.Toolbar.Separator

Properties

domObj

{HTMLElement} The DOM element that goes in the Jx.Toolbar

Functions

Jx. Toolbar. Separator

Create a new Jx.Toolbar.Separator

Jx. TreeItem

Extends: Object

Implements: Options, Events

An item in a tree.  An item is a leaf node that has no children.

Jx.TreeItem supports selection via the click event.  The application is responsible for changing the style of the selected item in the tree and for tracking selection if that is important.

Example

Events

clicktriggered when the tree item is clicked

Implements

EventsMooTools Class.Extras
OptionsMooTools Class.Extras

License

Copyright © 2008, DM Solutions Group Inc.

This file is licensed under an MIT style license

Summary
{HTMLElement} a reference to the HTML element that is the TreeItem in the DOM
{Object} the folder or tree that this item belongs to
Create a new instance of Jx.TreeItem with the associated options
Clean up the TreeItem and remove all DOM references
Clean up the TreeItem and remove all DOM references
Create a clone of the TreeItem
Update the CSS of the TreeItem’s DOM element in case it has changed position
Called when the DOM element for the TreeItem is clicked, the node is selected.
Get the label associated with a TreeItem
A property of an object has changed, synchronize the state of the TreeItem with the state of the object

Properties

domObj

{HTMLElement} a reference to the HTML element that is the TreeItem in the DOM

owner

{Object} the folder or tree that this item belongs to

Functions

Jx. TreeItem

Create a new instance of Jx.TreeItem with the associated options

Parameters

options<Jx.TreeItem.Options>

finalize

finalize: function()

Clean up the TreeItem and remove all DOM references

finalizeItem

finalizeItem: function()

Clean up the TreeItem and remove all DOM references

clone

clone : function()

Create a clone of the TreeItem

Returns

{Jx.TreeItem} a copy of the TreeItem

update

update : function(shouldDescend)

Update the CSS of the TreeItem’s DOM element in case it has changed position

Parameters

shouldDescend{Boolean} propagate changes to child nodes?

selected

selected : function(e)

Called when the DOM element for the TreeItem is clicked, the node is selected.

Parameters

e{Event} the DOM event

getName

getName : function()

Get the label associated with a TreeItem

Returns

{String} the name

propertyChanged

propertyChanged : function(obj)

A property of an object has changed, synchronize the state of the TreeItem with the state of the object

Parameters

obj{Object} the object whose state has changed

Jx. TreeFolder

Extends: Jx.TreeItem

A Jx.TreeFolder is an item in a tree that can contain other items.  It is expandable and collapsible.

Example

Extends

Jx.TreeItem

License

Copyright © 2008, DM Solutions Group Inc.

This file is licensed under an MIT style license

Summary
{HTMLElement} an HTML container for the things inside the folder
{Array} an array of references to the javascript objects that are children of this folder
Create a new instance of Jx.TreeFolder
Clean up a TreeFolder.
Internal method to clean up folder-related stuff.
Create a clone of the TreeFolder
Indicates if a node is the last thing in the folder.
Update the CSS of the TreeFolder’s DOM element in case it has changed position.
append a node at the end of the sub-tree
insert a node after refNode.
remove the specified node from the tree
Replace a node with another node
handle the user clicking on this folder by expanding or collapsing it.
Expands the folder
Collapses the folder
Get a reference to a child node by recursively searching the tree

Properties

subDomObj

{HTMLElement} an HTML container for the things inside the folder

nodes

{Array} an array of references to the javascript objects that are children of this folder

Functions

Jx. TreeFolder

Create a new instance of Jx.TreeFolder

Parameters

options<Jx.TreeFolder.Options> and <Jx.TreeItem.Options>

finalize

finalize: function()

Clean up a TreeFolder.

finalizeFolder

finalizeFolder: function()

Internal method to clean up folder-related stuff.

clone

clone : function()

Create a clone of the TreeFolder

Returns

{Jx.TreeFolder} a copy of the TreeFolder

isLastNode

isLastNode : function(node)

Indicates if a node is the last thing in the folder.

Parameters

node{Jx.TreeItem} the node to check

Returns

{Boolean}

update

update : function(shouldDescend)

Update the CSS of the TreeFolder’s DOM element in case it has changed position.

Parameters

shouldDescend{Boolean} propagate changes to child nodes?

append

append : function(node)

append a node at the end of the sub-tree

Parameters

node{Object} the node to append.

insert

insert : function(node,
refNode)

insert a node after refNode.  If refNode is null, insert at beginning

Parameters

node{Object} the node to insert
refNode{Object} the node to insert before

remove

remove : function(node)

remove the specified node from the tree

Parameters

node{Object} the node to remove

replace

replace: function(newNode,
refNode)

Replace a node with another node

Parameters

newNode{Object} the node to put into the tree
refNode{Object} the node to replace

Returns

{Boolean} true if the replacement was successful.

clicked

clicked : function(e)

handle the user clicking on this folder by expanding or collapsing it.

Parameters

e{Event} the event object

expand

expand : function()

Expands the folder

collapse

collapse : function()

Collapses the folder

findChild

findChild : function(path)

Get a reference to a child node by recursively searching the tree

Parameters

path{Array} an array of labels of nodes to search for

Returns

{Object} the node or null if the path was not found

Jx.Tree

Extends: Jx.TreeFolder

Implements: Jx.Addable

Jx.Tree displays hierarchical data in a tree structure of folders and nodes.

Example

Extends: Jx.TreeFolder

License

Copyright © 2008, DM Solutions Group Inc.

This file is licensed under an MIT style license

Summary
Create a new instance of Jx.Tree
Clean up a Jx.Tree instance
Clear the tree of all child nodes
Update the CSS of the Tree’s DOM element in case it has changed position
Append a node at the end of the sub-tree

Functions

Jx.Tree

Create a new instance of Jx.Tree

Parameters

options: options for Jx.Addable

finalize

finalize: function()

Clean up a Jx.Tree instance

clear

clear: function()

Clear the tree of all child nodes

update

update: function(shouldDescend)

Update the CSS of the Tree’s DOM element in case it has changed position

Parameters

shouldDescend{Boolean} propagate changes to child nodes?

append

append: function(node)

Append a node at the end of the sub-tree

Parameters

node{Object} the node to append.
Jx.applyPNGFilter = function(o)
Static method that applies the PNG Filter Hack for IE browsers when showing 24bit PNG’s.
Jx.addToImgQueue = function(obj)
Request that an image be set to a DOM IMG element src attribute.
Jx.checkImgQueue = function()
An internal method that ensures no more than 2 images are loading at a time.
Jx.loadNextImg = function()
An internal method actually populate the DOM element with the image source.
Jx.createIframeShim = function()
Creates a new iframe element that is intended to fill a container to mask out other operating system controls (scrollbars, inputs, buttons, etc) when HTML elements are supposed to be above them.
Jx.getNumber = function(n,
def)
safely parse a number and return its integer value.
Jx.getPageDimensions = function()
return the dimensions of the browser client area.
getContentBoxSize : function()
return the size of the content area of an element.
getBorderBoxSize: function()
return the size of the border area of an element.
getMarginBoxSize: function()
return the size of the margin area of an element.
setContentBoxSize : function(size)
set either or both of the width and height of an element to the provided size.
setBorderBoxSize : function(size)
set either or both of the width and height of an element to the provided size.
getPaddingSize : function ()
returns the padding for each edge of an element
getBorderSize : function()
returns the border size for each edge of an element
descendantOf: function(node)
determines if the element is a descendent of the reference node.
findElement: function(type)
search the parentage of the element to find an element of the given tag name.
loadContent: function(element)
triggers loading of content based on options set for the current object.
checkRequest: function()
Is fired after a delay to check the request to make sure it’s not failing in AIR.
position: function(element,
relative,
options)
positions an element relative to another element based on the provided options.
makeChrome: function(element)
create chrome on an element.
showChrome: function(element)
show the chrome on an element.
hideChrome: function()
removes the chrome from the DOM.
addTo: function(reference,
where)
adds the object to the DOM relative to another element.
clicked : function(evt)
triggered when the user clicks the button, processes the actionPerformed event
isEnabled: function()
This returns true if the button is enabled, false otherwise
setEnabled: function(enabled)
enable or disable the button.
isActive: function()
For toggle buttons, this returns true if the toggle button is currently active and false otherwise.
setActive: function(active)
Set the active state of the button
setImage: function(path)
set the image of this button to a new image URL
setLabel: function(label)
sets the text of the button.
getLabel: function()
returns the text of the button.
setTooltip: function(tooltip)
sets the tooltip displayed by the button
focus: function()
capture the keyboard focus on this button
blur: function()
remove the keyboard focus from this button
Extends: Object
initialize: function(options)
construct a new instance of a flyout button.
clicked: function(e)
Override Jx.Button::clicked to hide/show the content area of the flyout.
hide: function()
Closes the flyout if open
windowResize: function()
when the window is resized, any Jx.Layout controlled elements that are direct children of the BODY element are resized
resize: function(options)
resize the element controlled by this Jx.Layout object.
clicked : function(evt)
triggered when the user clicks the button, processes the actionPerformed event
swatchOver: function(e)
handle the mouse moving over a colour swatch by updating the preview
swatchClick: function(e)
handle mouse click on a swatch by updating the color and hiding the panel.
changed: function()
handle the user entering a new colour value manually by updating the selected colour if the entered value is valid HEX.
alphaChanged: function()
handle the user entering a new alpha value manually by updating the selected alpha if the entered value is valid alpha (0-100).
setColor: function(color)
set the colour represented by this colour panel
setAlpha: function(alpha)
set the alpha represented by this colour panel
updateSelected: function()
update the colour panel user interface based on the current colour and alpha values
Extends: Jx.Button
clicked: function()
override Jx.Button.Flyout to use a singleton color palette.
hide: function()
hide the color panel
setColor: function(color)
set the color represented by this color panel
setAlpha: function(alpha)
set the alpha represented by this color panel
changed: function(panel)
handle the color changing in the palette by updating the preview swatch in the button and firing the change event.
updateSwatch: function()
Update the swatch color for the current color
add : function()
Add menu items to the sub menu.
deactivate: function()
Deactivate the menu by hiding it.
onMouseOver: function(e)
Handle the user moving the mouse over the button for this menu by showing this menu and hiding the other menu.
eventInMenu: function(e)
determine if an event happened inside this menu or a sub menu of this menu.
hide: function(e)
Hide the menu.
show : function(o)
Show the menu
setVisibleItem: function(obj)
Set the sub menu that is currently open
Create a new instance of Jx.ButtonSet
add : function()
Add one or more Jx.Buttons to the ButtonSet.
remove : function(button)
Remove a button from this Button.
setActiveButton: function(button)
Set the active button to the one passed to this method
add: function()
adds one or more buttons to the Multi button.
remove: function(button)
remove a button from a multi button
setActiveButton: function(button)
update the menu item to be the requested button.
setButton: function(button)
update the active button in the menu item, trigger the button’s action and hide the flyout that contains the buttons.
Extends: Object
setOwner: function(obj)
Set the owner of this menu item
hide: function()
Hide the menu item.
clicked: function(obj)
Handle the user clicking on the menu item, overriding the Jx.Button::clicked method to facilitate menu tracking
Extends: Jx.Button
setEnabled: function(enabled)
enable or disable the combo button.
valueChanged: function()
invoked when the current value is changed
onKeyPress: function(e)
Handle the user pressing a key by looking for an ENTER key to set the value.
add: function()
add a new item to the pick list
remove: function(idx)
Remove the item at the given index.
setValue: function(value)
set the value of the Combo
getValue: function()
Return the current value
layoutContent: function()
the sizeChange event of the Jx.Layout that manages the outer container is intercepted and passed through this method to handle resizing of the panel contents because we need to do some calculations if the panel is collapsed and if there are toolbars to put around the content area.
Extends: Object
setLabel: function(s)
Set the label in the title bar of this panel
getLabel: function()
Get the label of the title bar of this panel
finalize: function()
Clean up the panel
maximize: function()
Maximize this panel
setContent : function (html)
set the content of this panel to some HTML
setContentURL : function (url)
Set the content of this panel to come from some URL.
panelContentLoaded: function(html)
When the content of the panel is loaded from a remote URL, this method is called when the ajax request returns.
setBusy : function(isBusy)
Set the panel as busy or not busy, which displays a loading image in the title bar.
toggleCollapse: function(state)
sets or toggles the collapsed state of the panel.
close: function()
Closes the panel (completely hiding it).
Extends: Object
resize: function(width,
height,
autoPosition)
resize the dialog.
sizeChanged: function()
overload panel’s sizeChanged method
toggleCollapse: function(state)
sets or toggles the collapsed state of the panel.
show : function( )
show the dialog, external code should use the Jx.Dialog::open method to make the dialog visible.
open: function()
open the dialog.
hide : function()
hide the dialog, external code should use the Jx.Dialog::close method to hide the dialog.
close: function()
close the dialog and trigger the onClose callback function if necessary
openURL: function(url)
open the dialog and load content from the provided url.
prepareElement: function()
Prepare a new, empty element to go into a split area.
prepareBar: function()
Prepare a new, empty bar to go into between split areas.
establishConstraints: function()
Setup the initial set of constraints that set the behaviour of the bars between the elements in the split area.
dragHorizontal: function(obj)
In a horizontally split container, handle a bar being dragged left or right by resizing the elements on either side of the bar.
dragVertical: function(obj)
In a vertically split container, handle a bar being dragged up or down by resizing the elements on either side of the bar.
sizeChanged: function()
handle the size of the container being changed.
horizontalResize: function()
Resize a horizontally layed-out container
verticalResize: function()
Resize a vertically layed out container.
maximizePanel: function(panel)
Maximize a panel, taking up all available space (taking into consideration any minimum or maximum values)
onScroll: function()
handle the grid scrolling by updating the position of the headers
resize: function()
resize the grid to fit inside its container.
setModel: function(model)
set the model for the grid to display.
destroyGrid: function()
destroy the contents of the grid safely
createGrid: function()
create the grid for the current model
setRowHeaderHeight: function(row,
height)
set the height of a row.
gridChanged: function(model,
row,
col,
value)
called through the grid listener interface when data has changed in the underlying model
prelightRowHeader: function(row)
apply the jxGridRowHeaderPrelight style to the header cell of a row.
prelightColumnHeader: function(col)
apply the jxGridColumnHeaderPrelight style to the header cell of a column.
prelightRow: function(row)
apply the jxGridRowPrelight style to row.
prelightColumn: function(col)
apply the jxGridColumnPrelight style to a column.
prelightCell: function(row,
col)
apply the jxGridCellPrelight style to a cell.
selectCell: function(row,
col)
Select a cell and apply the jxGridCellSelected style to it.
selectRowHeader: function(row,
selected)
Apply the jxGridRowHeaderSelected style to the row header cell of a selected row.
selectRow: function(row,
selected)
Select a row and apply the jxGridRowSelected style to it.
selectColumnHeader: function(col,
selected)
Apply the jxGridColumnHeaderSelected style to the column header cell of a selected column.
selectColumn: function(col,
selected)
Select a column.
onMouseMoveGrid: function(e)
handle the mouse moving over the main grid.
onMouseMoveRowHeader: function(e)
handle the mouse moving over the row header cells.
onMouseMoveColumnHeader: function(e)
handle the mouse moving over the column header cells.
onClickGrid: function(e)
handle the user clicking on the grid.
onClickRowHeader: function(e)
handle the user clicking on the row header.
onClickColumnHeader: function(e)
handle the user clicking on the column header.
getRowColumnFromEvent: function(e)
retrieve the row and column indexes from an event click.
getColumnCount: function()
This function returns the number of columns of data in the model as an integer value.
getColumnHeaderHTML: function(col)
This function returns an HTML string to be placed in the column header for the given column index.
getColumnHeaderHeight: function()
This function returns an integer which is the height of the column header row in pixels.
getColumnWidth: function(col)
This function returns an integer which is the width of the given column in pixels.
getRowHeaderHTML: function(row)
This function returns an HTML string to be placed in the row header for the given row index
getRowHeaderWidth: function()
This function returns an integer which is the width of the row header column in pixels.
getRowHeight: function(row)
This function returns an integer which is the height of the given row in pixels.
getRowCount: function()
This function returns the number of rows of data in the model as an integer value.
getValueAt: function(row,
col)
This function returns an HTML string which is the text to place in the cell at the given row and column.
setColumnWidth: function()
This function is called with a column index and width in pixels when a column is resized.
isCellEditable: function()
This function returns a boolean value to indicate if a given cell is editable by the user.
setValueAt: function(row,
col,
value)
This function is called with the row and column of a cell and a new value for the cell.
rowSelected: function(grid,
row)
This function is called by the grid to indicate that the user has selected a row by clicking on the row header.
columnSelected: function(grid,
col)
This function is called by the grid to indicate that the user has selected a column by clicking on the column header.
cellSelected: function(grid,
row,
col)
This function is called by the grid to indicate that the user has selected a cell by clicking on the cell in the grid.
show : function(e)
Show the context menu at the location of the mouse click
Extends: Jx.Menu.Item
setOwner: function(obj)
Set the ownder of this menu item
Extends: Jx.Button
Create a new instance of Jx.SubMenu
setOwner: function(obj)
Set the owner of this sub menu
show: function()
Show the sub menu
hide: function()
Hide the sub menu
add : function()
Add menu items to the sub menu.
insertBefore: function(newItem,
targetItem)
Insert a menu item before another menu item.
remove: function(item)
Remove a single menu item from the menu.
deactivate: function(e)
Deactivate the sub menu
isActive: function()
Indicate if this sub menu is active
setActive: function(isActive)
Set the active state of the Jx.Menu that contains this sub menu
setVisibleItem: function(obj)
Set a sub menu of this menu to be visible and hide the previously visible one.
Extends: Object
toggleElement: function()
Snap the element open or closed.
addTo: function(parent)
add this toolbar to a DOM element automatically creating a toolbar container if necessary
add: function( )
Add an item to the toolbar.
remove: function(item)
remove an item from a toolbar.
deactivate: function()
Deactivate the Toolbar (when it is acting as a menu bar).
isActive: function()
Indicate if the toolbar is currently active (as a menu bar)
setActive: function(b)
Set the active state of the toolbar (for menus)
setVisibleItem: function(obj)
For menus, they want to know which menu is currently open.
Create a new instance of Jx.TabSet within a specific element of the DOM.
resizeTabBox: function()
Resize the tab set content area and propogate the changes to each of the tabs managed by the tab set.
add: function()
Add one or more Jx.Button.Tabs to the TabSet.
Extends: Jx.Button
remove: function(tab)
Remove a tab from this TabSet.
setActiveTab: function(tab)
Set the active tab to the one passed to this method
Extends: Object
Extends: Object
add : function()
Add one or more Jx.Tabs to the TabBox.
remove : function(tab)
Remove a tab from the TabSet.
add: function( )
Add a toolbar to the container.
remove: function(item)
remove an item from a toolbar.
scrollIntoView: function(item)
scrolls an item in one of the toolbars into the currently visible area of the container if it is not already fully visible
finalize: function()
Clean up the TreeItem and remove all DOM references
finalizeItem: function()
Clean up the TreeItem and remove all DOM references
clone : function()
Create a clone of the TreeItem
update : function(shouldDescend)
Update the CSS of the TreeItem’s DOM element in case it has changed position
selected : function(e)
Called when the DOM element for the TreeItem is clicked, the node is selected.
getName : function()
Get the label associated with a TreeItem
propertyChanged : function(obj)
A property of an object has changed, synchronize the state of the TreeItem with the state of the object
Extends: Object
finalize: function()
Clean up a TreeFolder.
finalizeFolder: function()
Internal method to clean up folder-related stuff.
clone : function()
Create a clone of the TreeFolder
isLastNode : function(node)
Indicates if a node is the last thing in the folder.
update : function(shouldDescend)
Update the CSS of the TreeFolder’s DOM element in case it has changed position.
append : function(node)
append a node at the end of the sub-tree
insert : function(node,
refNode)
insert a node after refNode.
remove : function(node)
remove the specified node from the tree
replace: function(newNode,
refNode)
Replace a node with another node
clicked : function(e)
handle the user clicking on this folder by expanding or collapsing it.
expand : function()
Expands the folder
collapse : function()
Collapses the folder
findChild : function(path)
Get a reference to a child node by recursively searching the tree
finalize: function()
Clean up a Jx.Tree instance
clear: function()
Clear the tree of all child nodes
update: function(shouldDescend)
Update the CSS of the Tree’s DOM element in case it has changed position
append: function(node)
Append a node at the end of the sub-tree
A mix-in class that provides a helper function that allows an object to be added to an existing element on the page.
ContentLoader is a mix-in class that provides a consistent mechanism for other Jx controls to load content in one of four different ways:
Mix-in class that provides a method for positioning elements relative to other elements.
A mix-in class that provides chrome helper functions.
Extends: Object
Create a new instance of Jx.Layout.
Extends: Jx.Button.Flyout
Extends: Object
Create a new instance of Jx.TreeItem with the associated options
Create a new instance of Jx.TreeFolder
Extends: Jx.TreeItem