Core.jsMooTools | My Object Oriented JavaScript Tools. |
LicenseMIT-style license. CopyrightCopyright © 2006-2008 [Valerio Proietti](http://mad4milk.net/). Code & Documentation[The MooTools production team](http://mootools.net/developers/). InspirationSummary | | | | | | | 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. | | | | | | | | 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 | | | | | | the HTML element that contains the flyout content | | | | construct a new instance of a flyout button. | | | | Closes the flyout if open | | | | | | 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. | | | | | | {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 | | | | | | 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. | | | | | | 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 | | | | | | {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. | | | | | | Set the sub menu that is currently open | | | | | | {Array} array of buttons that are managed by this button set | | | | | | | | 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. | | | | | | 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. | | | | | | {<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 | | | | | | 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 | | | | | | | | 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 | | | | | | 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). | | | | | | 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 | | | | 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. | | | | close the dialog and trigger the onClose callback function if necessary | | | | | | {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. | | | | | | {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) | | | | | | 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 | | | | 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. | | | | 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. | | | | 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. | | | | | | create a new context menu | | Show the context menu at the location of the mouse click | | | | | | {HTMLElement} the HTML element that the separator is contained within | | | | | | Create a new instance of a menu separator | | Set the ownder of this menu item | | | | | | | | | | {HTMLElement} the HTML container for the sub menu. | | | | {<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 | | | | | | Add menu items to the sub menu. | | Insert a menu item before another menu item. | | Remove a single menu item from the 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. | | | | | | {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. | | | | | | {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. | | | | | | {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. | | | | Remove a tab from this TabSet. | | Set the active tab to the one passed to this method | | | | | | | | | | | | Create a new instance of a TabBox. | | Add one or more <Jx.Tab>s to the TabBox. | | Remove a tab from the TabSet. | | | | | | {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 | | | | | | {HTMLElement} an element to contain the thing to be placed in the toolbar. | | | | Create a new instance of Jx.Toolbar.Item. | | | | | | {HTMLElement} The DOM element that goes in the Jx.Toolbar | | | | Create a new Jx.Toolbar.Separator | | | | | | {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 | | | | | | {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 | | | | 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. | | | | | | Get a reference to a child node by recursively searching the tree | | | | | | 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 |
Browser.jsThe Browser Core. Contains Browser initialization, Window and Document, and the Browser Hash. LicenseMIT-style license.
Array.jsContains Array Prototypes like each, contains, and erase. LicenseMIT-style license.
Function.jsContains Function Prototypes like create, bind, pass, and delay. LicenseMIT-style license.
Number.jsContains Number Prototypes like limit, round, times, and ceil. LicenseMIT-style license.
String.jsContains String Prototypes like camelCase, capitalize, test, and toInt. LicenseMIT-style license.
Hash.jsContains Hash Prototypes. Provides a means for overcoming the JavaScript practical impossibility of extending native Objects. LicenseMIT-style license.
Event.jsContains the Event Native, to make the event object completely crossbrowser. LicenseMIT-style license.
Class.jsContains the Class Function for easily creating, extending, and implementing reusable Classes. LicenseMIT-style license.
Class. Extras.jsContains Utility Classes that can be implemented into your own Classes to ease the execution of many common tasks. LicenseMIT-style license.
Element.jsOne 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. LicenseMIT-style license.
Element. Event.jsContains Element methods for dealing with events, and custom Events. LicenseMIT-style license.
Element. Style.jsContains methods for interacting with the styles of Elements in a fashionable way. LicenseMIT-style license.
Element. Dimensions.jsContains methods to work with size, scroll, or positioning of Elements and the window object. LicenseMIT-style license. Credits
Selectors.jsAdds advanced CSS Querying capabilities for targeting elements. Also includes pseudoselectors support. LicenseMIT-style license.
Domready.jsContains the domready custom event. LicenseMIT-style license.
Cookie.jsClass for creating, loading, and saving browser Cookies. LicenseMIT-style license. CreditsBased on the functions by Peter-Paul Koch (http://quirksmode.org).
Swiff.jsWrapper for embedding SWF movies. Supports (and fixes) External Interface Communication. LicenseMIT-style license. CreditsFlash detection & Internet Explorer + Flash Player 9 fix inspired by SWFObject.
Fx.jsContains the basic animation logic to be extended by all other Fx Classes. LicenseMIT-style license.
Fx. CSS.jsContains the CSS animation logic. Used by Fx.Tween, Fx.Morph, Fx.Elements. LicenseMIT-style license.
Fx. Tween.jsFormerly Fx.Style, effect to transition any CSS property for an element. LicenseMIT-style license.
Fx. Morph.jsFormerly Fx.Styles, effect to transition any number of CSS properties for an element using an object of rules, or CSS based selector rules. LicenseMIT-style license.
Fx. Transitions.jsContains a set of advanced transitions to be used with any of the Fx Classes. LicenseMIT-style license. CreditsEasing Equations by Robert Penner, http://www.robertpenner.com/easing/, modified and optimized to be used with MooTools.
Request.jsPowerful all purpose Request Class. Uses XMLHTTPRequest. LicenseMIT-style license.
Request. JSON.jsExtends the basic Request Class with additional methods for sending and receiving JSON data. LicenseMIT-style license.
FormValidator.jsA css-class based form validation system. LicenseMIT-style license. AuthorsAaron Newton
FormValidator. Extras.jsAdditional validators for the FormValidator class. LicenseMIT-style license. AuthorsAaron Newton
Fx. Reveal.jsDefines Fx.Reveal, a class that shows and hides elements with a transition. LicenseMIT-style license. AuthorsAaron Newton
Fx. Slide.jsEffect to slide an element in and out of view. LicenseMIT-style license. AuthorsValerio Proietti
Fx. SmoothScroll.jsClass for creating a smooth scrolling effect to all internal links on the page. LicenseMIT-style license. AuthorsValerio Proietti
Drag. Move.jsA Drag extension that provides support for the constraining of draggables to containers and droppables. LicenseMIT-style license. AuthorsValerio Proietti Tom Occhinno Jan Kassens
Slider.jsClass for creating horizontal and vertical slider controls. LicenseMIT-style license. AuthorsValerio Proietti
Request. JSONP.jsDefines Request.JSONP, a class for cross domain javascript via script injection. LicenseMIT-style license. AuthorsAaron Newton Guillermo Rauch
Request. Periodical.jsRequests the same url at a time interval that increases when no data is returned from the requested server LicenseMIT-style license. AuthorsChristoph Pojer
Group.jsClass for monitoring collections of events LicenseMIT-style license. AuthorsValerio Proietti
Hash. Cookie.jsClass for creating, reading, and deleting Cookies in JSON format. LicenseMIT-style license. AuthorsValerio Proietti Aaron Newton
JxJx 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 LicenseCopyright © 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. |
{String} baseURLThis 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' }
applyPNGFilterJx.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. Parametersobject {Object} the object (img) to which the filter needs to be applied.
addToImgQueueJx.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. Parametersobj | {Object} an object containing an element and src property, where element is the element to update and src is the url to the image. |
checkImgQueueJx.checkImgQueue = function() |
An internal method that ensures no more than 2 images are loading at a time.
loadNextImgJx.loadNextImg = function() |
An internal method actually populate the DOM element with the image source.
createIframeShimJx.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. Returnsan HTML iframe element that can be inserted into the DOM.
getNumberJx.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. Parametersn | {Mixed} the string or object to parse. |
Returns{Integer} the integer value that the parameter represents
getPageDimensionsJx.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.
ElementElement 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. |
getContentBoxSizegetContentBoxSize : function() |
return the size of the content area of an element. This is the size of the element less margins, padding, and borders. Parameterselem | {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.
getBorderBoxSizegetBorderBoxSize: function() |
return the size of the border area of an element. This is the size of the element less margins. Parameterselem | {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.
getMarginBoxSizegetMarginBoxSize: function() |
return the size of the margin area of an element. This is the size of the element plus margins. Parameterselem | {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.
setContentBoxSizesetContentBoxSize : 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. Parameterselem | {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. |
setBorderBoxSizesetBorderBoxSize : 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. Parameterselem | {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. |
getPaddingSizegetPaddingSize : function () |
returns the padding for each edge of an element Parameterselem | {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.
getBorderSizegetBorderSize : function() |
returns the border size for each edge of an element Parameterselem | {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.
descendantOfdescendantOf: function( | node | ) |
|
determines if the element is a descendent of the reference node. Parametersnode | {HTMLElement} the reference node |
Returns{Boolean} true if the element is a descendent, false otherwise.
findElementfindElement: function( | type | ) |
|
search the parentage of the element to find an element of the given tag name. Parameterstype | {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. ContentLoaderContentLoader 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. |
contentIsLoadedtracks the load state of the content, specifically useful in the case of remote content.
loadContentloadContent: function( | element | ) |
|
triggers loading of content based on options set for the current object. Parameterselement | {Object} the element to insert the content into |
EventsContentLoader 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 contentLoaded | called when the content has been loaded. If the content is not asynchronous then this is called before loadContent returns. | contentLoadFailed | called if the content fails to load, primarily useful when using the contentURL method of loading content. |
checkRequest()Is fired after a delay to check the request to make sure it’s not failing in AIR.
Jx. AutoPositionMix-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. |
positionposition: 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 PositioningHorizontal 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 PositioningVertical 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.
Parameterselement | the element to position | relative | the element to position relative to | options | the positioning options, see list below. |
Optionshorizontal | the 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’. | vertical | the 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’. | offsets | an object containing numeric pixel offset values for the object being positioned as top, right, bottom and left properties. |
Jx. ChromeA 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. |
chromethe DOM element that contains the chrome
makeChromemakeChrome: function( | element | ) |
|
create chrome on an element. Parameterselement | {HTMLElement} the element to put the chrome on. |
showChromeshowChrome: 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. Parameterselement | {HTMLElement} the element to show the chrome on. |
hideChromeremoves the chrome from the DOM. If you do this, you can’t call showChrome with no arguments.
Jx. AddableA 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. |
addToaddTo: 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. Parametersreference | {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’. |
Returnsthe object itself, which is useful for chaining calls together
Jx. ButtonExtends: 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. Examplevar 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'); }
Eventsclick | the button was pressed and released (only if type is not ‘toggle’). | down | the button is down (only if type is ‘toggle’) | up | the button is up (only if the type is ‘toggle’). |
LicenseCopyright © 2008, DM Solutions Group Inc. This file is licensed under an MIT style license Summary | | | | | 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 |
Jx. Buttoncreate a new button. Parametersoptions | {Object} an object containing optional properties for this button as below. |
clickedtriggered when the user clicks the button, processes the actionPerformed event Parametersevt | {Event} the user click event |
isEnabledThis returns true if the button is enabled, false otherwise Returns{Boolean} whether the button is enabled or not
setEnabledsetEnabled: function( | enabled | ) |
|
enable or disable the button. Parametersenabled | {Boolean} the new enabled state of the button |
isActiveFor toggle buttons, this returns true if the toggle button is currently active and false otherwise. Returns{Boolean} the active state of a toggle button
setActivesetActive: function( | active | ) |
|
Set the active state of the button Parametersactive | {Boolean} the new active state of the button |
setImageset the image of this button to a new image URL Parameterspath | {String} the new url to use as the image for this button |
setLabelsetLabel: function( | label | ) |
|
sets the text of the button. Only works if a label was supplied when the button was constructed Parameterslabel | {String} the new label for the button |
getLabelreturns the text of the button.
setTooltipsetTooltip: function( | tooltip | ) |
|
sets the tooltip displayed by the button Parameterstooltip | {String} the new tooltip |
focuscapture the keyboard focus on this button
blurremove the keyboard focus from this button
Jx. Button. FlyoutExtends: 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. Examplevar flyout = new Jx.Button.Flyout({ label: 'flyout', content: 'flyoutContent', onOpen: function(flyout) { console.log('flyout opened'); }, onClose: function(flyout) { console.log('flyout closed'); } });
Eventsopen | this event is triggered when the flyout is opened. | close | this event is triggered when the flyout is closed. |
LicenseCopyright © 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. | | | | Closes the flyout if open |
contentthe HTML element that contains the flyout content
initializeinitialize: 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. Parametersoptions | an options object used to initialize the button, see <Jx.Button.Options>, <Jx.ContentLoader.Options>, and <Jx.AutoPosition.Options> for details. |
hideCloses the flyout if open
Jx. LayoutExtends: 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. Examplevar myContainer = new Jx.Layout('myDiv', options);
EventssizeChange | fired when the size of the container changes |
LicenseCopyright © 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. |
Jx. LayoutCreate a new instance of Jx.Layout. ParametersdomObj | {HTMLElement} element or id to apply the layout to | options | <Jx.Layout.Options> |
windowResizewhen the window is resized, any Jx.Layout controlled elements that are direct children of the BODY element are resized
resizeresize: function( | options | ) |
|
resize the element controlled by this Jx.Layout object. Parametersoptions | new options to apply, see <Jx.Layout.Options> |
Jx. Button.TabExtends: 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. Examplevar 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'); } });
LicenseCopyright © 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 |
content{HTMLElement} The content area that is displayed when the tab is active.
Jx. Button.TabCreate a new instance of Jx.Button.Tab. Any layout options passed are used to create a Jx.Layout for the tab content area. Parameters
clickedtriggered when the user clicks the button, processes the actionPerformed event
Jx. ColorPaletteExtends: 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
Eventschange | triggered when the color changes. | click | the user clicked on a color swatch (emitted after a change event) |
LicenseCopyright © 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 |
{HTMLElement} domObjthe HTML element representing the color panel
Jx. ColorPaletteinitialize a new instance of Jx.ColorPalette Parametersoptions | <Jx.ColorPalette.Options> |
swatchOverhandle the mouse moving over a colour swatch by updating the preview Parameterse | {Event} the mousemove event object |
swatchClickhandle mouse click on a swatch by updating the color and hiding the panel. Parameterse | {Event} the mouseclick event object |
changedhandle the user entering a new colour value manually by updating the selected colour if the entered value is valid HEX.
alphaChangedhandle the user entering a new alpha value manually by updating the selected alpha if the entered value is valid alpha (0-100).
setColorsetColor: function( | color | ) |
|
set the colour represented by this colour panel Parameterscolor | {String} the new hex color value |
setAlphasetAlpha: function( | alpha | ) |
|
set the alpha represented by this colour panel Parametersalpha | {Integer} the new alpha value (between 0 and 100) |
updateSelectedupdateSelected: function() |
update the colour panel user interface based on the current colour and alpha values
Jx. Button. ColorExtends: 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. Examplevar colorButton = new Jx.Button.Color({ onChange: function(button) { console.log('color:' + button.options.color + ' alpha: ' + button.options.alpha); } });
Eventschange | fired when the color is changed. |
LicenseCopyright © 2008, DM Solutions Group Inc. This file is licensed under an MIT style license Summary | | | initialize a new color button. | | | | | | 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 |
Jx. Button. Colorinitialize a new color button. Parametersoptions | <Jx.Button.Color.Options> initialize instance options. |
setColorsetColor: function( | color | ) |
|
set the color represented by this color panel Parameterscolor | {String} the new hex color value |
setAlphasetAlpha: function( | alpha | ) |
|
set the alpha represented by this color panel Parametersalpha | {Integer} the new alpha value (between 0 and 100) |
changedhandle the color changing in the palette by updating the preview swatch in the button and firing the change event. Parameters
updateSwatchUpdate the swatch color for the current color
Jx.MenuExtends: 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
LicenseCopyright © 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. | | | | | | Set the sub menu that is currently open |
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
Jx.MenuCreate a new instance of Jx.Menu. Parametersoptions | see <Jx.Button.Options>. If no options are provided then no button is created. |
addAdd menu items to the sub menu. Parametersitem | {<Jx.MenuItem>} the menu item to add. Multiple menu items can be added by passing multiple arguments to this function. |
deactivateDeactivate the menu by hiding it.
onMouseOverHandle the user moving the mouse over the button for this menu by showing this menu and hiding the other menu. Parameters
eventInMenudetermine if an event happened inside this menu or a sub menu of this menu. ParametersReturns{Boolean} true if the event happened in the menu or a sub menu of this menu, false otherwise
setVisibleItemsetVisibleItem: function( | obj | ) |
|
Set the sub menu that is currently open Parametersobj- {<Jx.SubMenu>} the sub menu that just became visible
Jx. ButtonSetExtends: 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. Examplevar 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);
Eventschange | the current button has changed |
LicenseCopyright © 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 | | | | | | | | 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. |
buttons{Array} array of buttons that are managed by this button set
Jx. ButtonSetCreate a new instance of Jx.ButtonSet Parametersoptions | an options object, only event handlers are supported as options at this time. |
addAdd one or more Jx.Buttons to the ButtonSet. Parametersbutton | {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. |
removeremove : function( | button | ) |
|
Remove a button from this Button. Parameters
setActiveButtonsetActiveButton: function( | button | ) |
|
Set the active button to the one passed to this method Parameters
selectionChangedHandle selection changing on the buttons themselves and activate the appropriate button in response. Parameters
Jx. Button. MultiExtends: Jx.Button ImplementsMulti 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. Examplevar 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);
LicenseCopyright © 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. |
{<Jx. Button>} activeButtonthe currently selected button
buttons{Array} the buttons added to this multi button
Jx. Button. Multiconstruct a new instance of Jx.Button.Multi.
addadds 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
removeremove a button from a multi button Parameters
setActiveButtonsetActiveButton: function( | button | ) |
|
update the menu item to be the requested button. Parameters
setButtonsetButton: function( | button | ) |
|
update the active button in the menu item, trigger the button’s action and hide the flyout that contains the buttons. Parametersbutton | {Jx.Button} The button to set as the active button |
Jx. Menu.ItemExtends: 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
Eventsclick | fired when the menu item is clicked. |
LicenseCopyright © 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 | | | | | | 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 |
owner{<Jx.SubMenu> or Jx.Menu} the menu that contains the menu item.
Jx. Menu.ItemCreate a new instance of Jx.Menu.Item Parametersoptions | See <Jx.Button.Options> |
setOwnerSet the owner of this menu item Parametersobj | {Object} the new owner |
clickedHandle the user clicking on the menu item, overriding the Jx.Button::clicked method to facilitate menu tracking Parametersobj | {Object} an object containing an event property that was the user event. |
onmouseoverhandle the mouse moving over the menu item Parameterse | {Event} the mousemove event |
Jx. Button. ComboExtends: Jx.Button.Multi A drop down list of selectable items. Items can be either a string, an image or both. Examplenew 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()) } })
Eventschange | triggered when the user selects a new item from the list |
LicenseCopyright © 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 | | |
currentSelection{Object} current selection in the list
Jx. Combocreate a new instance of Jx.Combo Parametersoptions | <Jx.button.Combo.Options> |
setEnabledsetEnabled: function( | enabled | ) |
|
enable or disable the combo button. Parametersenabled | {Boolean} the new enabled state of the button |
valueChangedinvoked when the current value is changed
onKeyPressHandle the user pressing a key by looking for an ENTER key to set the value. Parameterse | {Event} the keypress event |
addadd a new item to the pick list Parametersoptions | {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. |
removeRemove the item at the given index. Not implemented. Parametersidx | {Integer} the item to remove. |
setValuesetValue: function( | value | ) |
|
set the value of the Combo Parametersvalue | {Object} the new value. May be a string, a text node, or another DOM element. |
getValueReturn the current value Returns{Object} returns the currently selected item
Jx. PanelExtends: 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
Eventsclose | fired when the panel is closed | collapse | fired when the panel is collapsed | expand | fired when the panel is opened |
LicenseCopyright © 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 | | | | | | 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). |
Jx. PanelInitialize a new Jx.Panel instance Options: <Jx.Panel.Options>, <Jx.ContentLoader.Options>
layoutContentlayoutContent: 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.
setLabelSet the label in the title bar of this panel Parameters
getLabelGet the label of the title bar of this panel Returns{String} the label
setContentsetContent : function ( | html | ) |
|
set the content of this panel to some HTML Parametershtml | {String} the new HTML to go in the panel |
setContentURLsetContentURL : function ( | url | ) |
|
Set the content of this panel to come from some URL. Parametersurl | {String} URL to some HTML content for this panel |
panelContentLoadedpanelContentLoaded: function( | html | ) |
|
When the content of the panel is loaded from a remote URL, this method is called when the ajax request returns. Parametershtml | {String} the html return from xhr.onSuccess |
setBusysetBusy : function( | isBusy | ) |
|
Set the panel as busy or not busy, which displays a loading image in the title bar. ParametersisBusy | {Boolean} the busy state |
toggleCollapsetoggleCollapse: 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. Parametersstate | optional, if passed then the state is used, otherwise the state is toggled. |
closeCloses the panel (completely hiding it).
Jx. DialogExtends: 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. Examplevar dialog = new Jx.Dialog();
Eventsopen | triggered when the dialog is opened | close | triggered when the dialog is closed | change | triggered when the value of an input in the dialog is changed | resize | triggered when the dialog is resized |
ExtendsJx.Dialog extends Jx.Panel, please go there for more details. LicenseCopyright © 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 | | | | 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. | | | | close the dialog and trigger the onClose callback function if necessary |
{HTMLElement} blanketmodal 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.
Jx. DialogConstruct a new instance of Jx.Dialog Parametersoptions | {Object} an object containing options for the dialog. |
Options: <Jx.Dialog.Options>, <Jx.Panel.Options>, <Jx.ContentLoader.Options>
resizeresize: function( | width, | | height, | | autoPosition | ) |
|
resize the dialog. This can be called when the dialog is closed or open. Parameterswidth | the new width | height | the new height | autoPosition | boolean, false by default, if resizing an open dialog setting this to true will reposition it according to its position rules. |
sizeChangedoverload panel’s sizeChanged method
toggleCollapsetoggleCollapse: 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. Parametersstate | optional, if passed then the state is used, otherwise the state is toggled. |
showshow the dialog, external code should use the Jx.Dialog::open method to make the dialog visible.
hidehide the dialog, external code should use the Jx.Dialog::close method to hide the dialog.
openURLopen the dialog and load content from the provided url. If you don’t provide a URL then the dialog opens normally. Parametersurl | <String> the url to load when opening. |
openopen 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
closeclose the dialog and trigger the onClose callback function if necessary
Jx. SplitterExtends: 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
LicenseCopyright © 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. |
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.
Jx. SplitterCreate a new instance of Jx.Splitter ParametersdomObj | {HTMLElement} the element or id of the element to split | options | <Jx.Splitter.Options> |
prepareElementprepareElement: function() |
Prepare a new, empty element to go into a split area. Returns{HTMLElement} an HTMLElement that goes into a split area.
prepareBarPrepare a new, empty bar to go into between split areas. Returns{HTMLElement} an HTMLElement that becomes a bar.
establishConstraintsestablishConstraints: function() |
Setup the initial set of constraints that set the behaviour of the bars between the elements in the split area.
dragHorizontaldragHorizontal: 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. Parametersobj | {HTMLElement} the bar that was dragged |
dragVerticaldragVertical: 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. Parametersobj | {HTMLElement} the bar that was dragged |
sizeChangedhandle the size of the container being changed.
horizontalResizehorizontalResize: function() |
Resize a horizontally layed-out container
verticalResizeverticalResize: function() |
Resize a vertically layed out container.
Jx. PanelSetExtends: 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. Examplevar 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]);
LicenseCopyright © 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) |
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
Jx. PanelSetCreate a new instance of Jx.PanelSet. Parametersoptions | <Jx.PanelSet.Options> |
TODO: Jx.PanelSet.initialize Remove the panels parameter in favour of an add method.
maximizePanelmaximizePanel: function( | panel | ) |
|
Maximize a panel, taking up all available space (taking into consideration any minimum or maximum values)
Jx.GridExtends: 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
LicenseCopyright © 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 | | | | 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. | | | | 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. | | | | 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. |
Jx.Gridconstruct a new instance of Jx.Grid within the domObj Parameters
onScrollhandle the grid scrolling by updating the position of the headers
resizeresize 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
setModelsetModel: 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. Parametersmodel | {Object} the model to use for this grid |
destroyGriddestroy the contents of the grid safely
createGridcreate the grid for the current model
setRowHeaderHeightsetRowHeaderHeight: 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 Parametersrow | {Integer} the row to set the height for | height | {Integer} the height to set the row (in pixels) |
gridChangedgridChanged: function( | model, | | row, | | col, | | value | ) |
|
called through the grid listener interface when data has changed in the underlying model Parametersmodel | {Object} the model that changed | row | {Integer} the row that changed | col | {Integer} the column that changed | value | {Mixed} the new value |
prelightRowHeaderprelightRowHeader: function( | row | ) |
|
apply the jxGridRowHeaderPrelight style to the header cell of a row. This removes the style from the previously pre-lit row header. Parametersrow | {Integer} the row to pre-light the header cell of |
prelightColumnHeaderprelightColumnHeader: function( | col | ) |
|
apply the jxGridColumnHeaderPrelight style to the header cell of a column. This removes the style from the previously pre-lit column header. Parameterscol | {Integer} the column to pre-light the header cell of |
prelightRowprelightRow: function( | row | ) |
|
apply the jxGridRowPrelight style to row. This removes the style from the previously pre-lit row. Parametersrow | {Integer} the row to pre-light |
prelightColumnprelightColumn: function( | col | ) |
|
apply the jxGridColumnPrelight style to a column. This removes the style from the previously pre-lit column. Parameterscol | {Integer} the column to pre-light |
TODO: Jx.Grid.prelightColumn Not Yet Implemented.
prelightCellprelightCell: function( | row, | | col | ) |
|
apply the jxGridCellPrelight style to a cell. This removes the style from the previously pre-lit cell. Parametersrow | {Integer} the row of the cell to pre-light | col | {Integer} the column of the cell to pre-light |
selectCellselectCell: 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. Parametersrow | {Integer} the row of the cell to select | col | {Integer} the column of the cell to select |
selectRowHeaderselectRowHeader: function( | row, | | selected | ) |
|
Apply the jxGridRowHeaderSelected style to the row header cell of a selected row. Parametersrow | {Integer} the row header to select | selected | {Boolean} the new state of the row header |
selectRowselectRow: 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. Parametersrow | {Integer} the row to select | selected | {Boolean} the new state of the row |
selectColumnHeaderselectColumnHeader: function( | col, | | selected | ) |
|
Apply the jxGridColumnHeaderSelected style to the column header cell of a selected column. Parameterscol | {Integer} the column header to select | selected | {Boolean} the new state of the column header |
selectColumnselectColumn: function( | col, | | selected | ) |
|
Select a column. This deselects a previously selected column. Parameterscol | {Integer} the column to select | selected | {Boolean} the new state of the column |
onMouseMoveGridonMouseMoveGrid: function( | e | ) |
|
handle the mouse moving over the main grid. This pre-lights the cell, and subsquently the row and column (and headers). Parameterse | {Event} the browser event object |
onMouseMoveRowHeaderonMouseMoveRowHeader: function( | e | ) |
|
handle the mouse moving over the row header cells. This pre-lights the row and subsequently the row header. Parameterse | {Event} the browser event object |
onMouseMoveColumnHeaderonMouseMoveColumnHeader: function( | e | ) |
|
handle the mouse moving over the column header cells. This pre-lights the column and subsequently the column header. Parameterse | {Event} the browser event object |
onClickGridhandle 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
onClickRowHeaderonClickRowHeader: 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); }
Parameterse | {Event} the browser event object |
onClickColumnHeaderonClickColumnHeader: 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); }
Parameterse | {Event} the browser event object |
getRowColumnFromEventgetRowColumnFromEvent: 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 Parameterse | {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. Modelcreate a new grid model Parametersdata | array of data to display in the grid | options | <Jx.Grid.Model.Options> |
getColumnCountgetColumnCount: function() |
This function returns the number of columns of data in the model as an integer value.
getColumnHeaderHTMLgetColumnHeaderHTML: function( | col | ) |
|
This function returns an HTML string to be placed in the column header for the given column index.
getColumnHeaderHeightgetColumnHeaderHeight: function() |
This function returns an integer which is the height of the column header row in pixels.
getColumnWidthgetColumnWidth: function( | col | ) |
|
This function returns an integer which is the width of the given column in pixels.
getRowHeaderHTMLgetRowHeaderHTML: function( | row | ) |
|
This function returns an HTML string to be placed in the row header for the given row index
getRowHeaderWidthgetRowHeaderWidth: function() |
This function returns an integer which is the width of the row header column in pixels.
getRowHeightgetRowHeight: function( | row | ) |
|
This function returns an integer which is the height of the given row in pixels.
getRowCountThis function returns the number of rows of data in the model as an integer value.
getValueAtgetValueAt: function( | row, | | col | ) |
|
This function returns an HTML string which is the text to place in the cell at the given row and column.
setColumnWidthsetColumnWidth: 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.
isCellEditableisCellEditable: function() |
This function returns a boolean value to indicate if a given cell is editable by the user.
setValueAtsetValueAt: 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.
rowSelectedrowSelected: 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.
columnSelectedcolumnSelected: 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.
cellSelectedcellSelected: 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. ContextExtends: 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
EventsTODO | add open/close events? |
LicenseCopyright © 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 |
Jx. ContextMenucreate a new context menu Parametersid | {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. |
showShow the context menu at the location of the mouse click Parameters
Jx. Menu. SeparatorExtends: Object A convenience class to create a visual separator in a menu. Example
LicenseCopyright © 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 | | | | | | Create a new instance of a menu separator | | Set the ownder of this menu item | | | | |
domObj{HTMLElement} the HTML element that the separator is contained within
Jx. Menu. SeparatorCreate a new instance of a menu separator
setOwnerSet the ownder of this menu item Parametersobj | {Object} the new owner |
Jx. Menu. SubMenuExtends: 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
LicenseCopyright © 2008, DM Solutions Group Inc. This file is licensed under an MIT style license Summary | | | {HTMLElement} the HTML container for the sub menu. | | | | {<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 | | | | | | Add menu items to the sub menu. | | Insert a menu item before another menu item. | | Remove a single menu item from the 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. |
subDomObj{HTMLElement} the HTML container for the sub menu.
visibleItem{<Jx.MenuItem>} the visible item within the menu
items{Array} the menu items that are in this sub menu.
Jx. SubMenuCreate a new instance of Jx.SubMenu Parametersoptions | see <Jx.Button.Options> |
setOwnerSet the owner of this sub menu Parameters
addAdd menu items to the sub menu. Parametersitem | {<Jx.MenuItem>} the menu item to add. Multiple menu items can be added by passing multiple arguments to this function. |
insertBeforeinsertBefore: function( | newItem, | | targetItem | ) |
|
Insert a menu item before another menu item. ParametersnewItem | {<Jx.MenuItem>} the menu item to insert | targetItem | {<Jx.MenuItem>} the menu item to insert before |
removeRemove a single menu item from the menu. Parametersitem | {<Jx.MenuItem} the menu item to remove. |
deactivateDeactivate the sub menu Parameterse | {Event} the event that triggered the menu being deactivated. |
isActiveIndicate if this sub menu is active Returns{Boolean} true if the Jx.Menu that ultimately contains this sub menu is active, false otherwise.
setActivesetActive: function( | isActive | ) |
|
Set the active state of the Jx.Menu that contains this sub menu ParametersisActive | {Boolean} the new active state |
setVisibleItemsetVisibleItem: function( | obj | ) |
|
Set a sub menu of this menu to be visible and hide the previously visible one. Parametersobj | {Jx.SubMenu} the sub menu that should be visible |
Jx. Splitter.SnapExtends: Object A helper class to create an element that can snap a split panel open or closed. Example
LicenseCopyright © 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. |
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.
Jx. Splitter.SnapCreate a new Jx.Splitter.Snap Parameterssnap | {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. |
toggleElementtoggleElement: function() |
Snap the element open or closed.
sizeChangedHandle the size of the element changing to see if the toggle state has changed.
Jx. ToolbarExtends: 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. ExampleThe 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);
Eventsadd | fired when one or more buttons are added to a toolbar | remove | fired when on eor more buttons are removed from a toolbar |
ImplementsOptions LicenseCopyright © 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. |
items{Array} an array of the things in the toolbar.
domObj{HTMLElement} the HTML element that the toolbar lives in
isActiveWhen 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.
Jx. ToolbarCreate a new instance of Jx.Toolbar. Parametersoptions | <Jx.Toolbar.Options> |
addToadd this toolbar to a DOM element automatically creating a toolbar container if necessary Parametersparent | the DOM element or toolbar container to add this toolbar to. |
addAdd 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>. Parametersthing | {Object} the thing to add. More than one thing can be added by passing multiple arguments. |
removeremove an item from a toolbar. If the item is not in this toolbar nothing happens Parametersitem | {Object} the object to remove |
Returns{Object} the item that was removed, or null if the item was not removed.
deactivateDeactivate the Toolbar (when it is acting as a menu bar).
isActiveIndicate if the toolbar is currently active (as a menu bar) Returns{Boolean}
setActiveSet the active state of the toolbar (for menus) Parameters
setVisibleItemsetVisibleItem: function( | obj | ) |
|
For menus, they want to know which menu is currently open. Parametersobj | {Jx.Menu} the menu that just opened. |
Jx. TabSetExtends: 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. Examplevar 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);
EventstabChange | the current tab has changed |
LicenseCopyright © 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. | | | | Remove a tab from this TabSet. | | Set the active tab to the one passed to this method |
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.
Jx. TabSetCreate a new instance of Jx.TabSet within a specific element of the DOM. ParametersdomObj | {HTMLElement} an element or id of an element to put the content of the tabs into. | options | an options object, only event handlers are supported as options at this time. |
resizeTabBoxResize the tab set content area and propogate the changes to each of the tabs managed by the tab set.
addAdd one or more Jx.Button.Tabs to the TabSet. Parameterstab | {<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. |
removeRemove a tab from this TabSet. Note that it is the caller’s responsibility to remove the tab from the Jx.Toolbar. Parameterstab | {<Jx.Tab>} the tab to remove. |
setActiveTabsetActiveTab: function( | tab | ) |
|
Set the active tab to the one passed to this method Parameters
Jx. TabBoxExtends: 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. Examplevar 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);
LicenseCopyright © 2008, DM Solutions Group Inc. This file is licensed under an MIT style license Summary | | | | | | | | | Create a new instance of a TabBox. | | Add one or more <Jx.Tab>s to the TabBox. | | Remove a tab from the TabSet. |
tabSet{Jx.TabSet} the tab set for this tab box.
Jx. TabBoxCreate a new instance of a TabBox. Parametersoptions | <Jx.TabBox.Options> |
addAdd one or more <Jx.Tab>s to the TabBox. Parameterstab | {<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. |
removeRemove a tab from the TabSet. Parameterstab | {<Jx.Tab>} the tab to remove. |
Jx. Toolbar. ContainerExtends: 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. Eventsadd | fired when one or more toolbars are added to a container | remove | fired when one or more toolbars are removed from a container |
ImplementsOptions Events {Jx.Addable} LicenseCopyright © 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 |
domObj{HTMLElement} the HTML element that the container lives in
Jx. Toolbar. ContainerCreate a new instance of Jx.Toolbar.Container Parametersoptions | <Jx.Toolbar.Options> |
addAdd a toolbar to the container. Parameterstoolbar | {Object} the toolbar to add. More than one toolbar can be added by passing multiple arguments. |
removeremove an item from a toolbar. If the item is not in this toolbar nothing happens Parametersitem | {Object} the object to remove |
Returns{Object} the item that was removed, or null if the item was not removed.
scrollIntoViewscrollIntoView: 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
Jx. Toolbar.ItemExtends: Object Implements: Options A helper class to provide a container for something to go into a Jx.Toolbar. LicenseCopyright © 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. |
domObj{HTMLElement} an element to contain the thing to be placed in the toolbar.
Jx. Toolbar.ItemCreate a new instance of Jx.Toolbar.Item. ParametersjxThing | {Object} the thing to be contained. |
Jx. Toolbar. SeparatorExtends: Object A helper class that represents a visual separator in a Jx.Toolbar Example
LicenseCopyright © 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 |
domObj{HTMLElement} The DOM element that goes in the Jx.Toolbar
Jx. Toolbar. SeparatorCreate a new Jx.Toolbar.Separator
Jx. TreeItemExtends: 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
Eventsclick | triggered when the tree item is clicked |
ImplementsEvents | MooTools Class.Extras | Options | MooTools Class.Extras |
LicenseCopyright © 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 |
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
Jx. TreeItemCreate a new instance of Jx.TreeItem with the associated options Parametersoptions | <Jx.TreeItem.Options> |
finalizeClean up the TreeItem and remove all DOM references
finalizeItemClean up the TreeItem and remove all DOM references
cloneCreate a clone of the TreeItem Returns{Jx.TreeItem} a copy of the TreeItem
updateupdate : function( | shouldDescend | ) |
|
Update the CSS of the TreeItem’s DOM element in case it has changed position ParametersshouldDescend | {Boolean} propagate changes to child nodes? |
selectedCalled when the DOM element for the TreeItem is clicked, the node is selected. Parameters
getNameGet the label associated with a TreeItem Returns{String} the name
propertyChangedpropertyChanged : function( | obj | ) |
|
A property of an object has changed, synchronize the state of the TreeItem with the state of the object Parametersobj | {Object} the object whose state has changed |
Jx. TreeFolderExtends: Jx.TreeItem A Jx.TreeFolder is an item in a tree that can contain other items. It is expandable and collapsible. Example
ExtendsJx.TreeItem LicenseCopyright © 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 | | | | 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. | | | | | | Get a reference to a child node by recursively searching the tree |
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
Jx. TreeFolderCreate a new instance of Jx.TreeFolder Parametersoptions | <Jx.TreeFolder.Options> and <Jx.TreeItem.Options> |
finalizeFolderfinalizeFolder: function() |
Internal method to clean up folder-related stuff.
cloneCreate a clone of the TreeFolder Returns{Jx.TreeFolder} a copy of the TreeFolder
isLastNodeisLastNode : function( | node | ) |
|
Indicates if a node is the last thing in the folder. Parametersnode | {Jx.TreeItem} the node to check |
Returns{Boolean}
updateupdate : function( | shouldDescend | ) |
|
Update the CSS of the TreeFolder’s DOM element in case it has changed position. ParametersshouldDescend | {Boolean} propagate changes to child nodes? |
appendappend a node at the end of the sub-tree Parametersnode | {Object} the node to append. |
insertinsert : function( | node, | | refNode | ) |
|
insert a node after refNode. If refNode is null, insert at beginning Parametersnode | {Object} the node to insert | refNode | {Object} the node to insert before |
removeremove the specified node from the tree Parametersnode | {Object} the node to remove |
replacereplace: function( | newNode, | | refNode | ) |
|
Replace a node with another node ParametersnewNode | {Object} the node to put into the tree | refNode | {Object} the node to replace |
Returns{Boolean} true if the replacement was successful.
clickedhandle the user clicking on this folder by expanding or collapsing it. Parameterse | {Event} the event object |
findChildfindChild : function( | path | ) |
|
Get a reference to a child node by recursively searching the tree Parameterspath | {Array} an array of labels of nodes to search for |
Returns{Object} the node or null if the path was not found
Jx.TreeExtends: Jx.TreeFolder Implements: Jx.Addable Jx.Tree displays hierarchical data in a tree structure of folders and nodes. Example
Extends: Jx.TreeFolder LicenseCopyright © 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 |
Jx.TreeCreate a new instance of Jx.Tree Parametersoptions: options for Jx.Addable
finalizeClean up a Jx.Tree instance
clearClear the tree of all child nodes
updateupdate: function( | shouldDescend | ) |
|
Update the CSS of the Tree’s DOM element in case it has changed position ParametersshouldDescend | {Boolean} propagate changes to child nodes? |
appendAppend a node at the end of the sub-tree Parametersnode | {Object} the node to append. |
|