Behavior

Utility class for JavaScript behaviors

abstract
since

1.5

package

Joomla CMS

Methods

calendartranslation

Internal method to translate the JavaScript Calendar

calendartranslation() : 
static
since

1.5

Response

stringJavaScript that translates the object

combobox

Add unobtrusive JavaScript support for a combobox effect.

combobox() : 
static deprecated

Note that this control is only reliable in absolutely positioned elements. Avoid using a combobox in a slider or dynamic pane.

since

1.5

deprecated

4.0 will be removed in 6.0 Use the webasset manager instead Example: Factory::getApplication()->getDocument()->getWebAssetManager()->useScript('awesomeplete');

Response

void

core

Method to load core.js into the document head.

core() : 
static deprecated

Core.js defines the 'Joomla' namespace and contains functions which are used across extensions

since

3.3

deprecated

4.0 will be removed in 6.0 Use the webasset manager instead Example: Factory::getApplication()->getDocument()->getWebAssetManager()->useScript('core');

Response

void

formvalidator

Add unobtrusive JavaScript support for form validation.

formvalidator() : 
static deprecated

To enable form validation the form tag must have class="form-validate". Each field that needs to be validated needs to have class="validate". Additional handlers can be added to the handler for username, password, numeric and email. To use these add class="validate-email" and so on.

since

3.4

deprecated

4.0 will be removed in 6.0 Use the webasset manager instead Example: Factory::getApplication()->getDocument()->getWebAssetManager()->useScript('form.validate');

Response

void

highlighter

Highlight some words via Javascript.

highlighter(mixed||string|int terms,  start = 'highlighter-start',  end = 'highlighter-end',  className = 'highlight',  tag = 'span') : 
static deprecated
since

2.5

deprecated

4.0 will be removed in 6.0 Use the script directly

Arguments

terms

array<string|int, mixed>Array of words that should be highlighted.

start

stringID of the element that marks the begin of the section in which words should be highlighted. Note this element will be removed from the DOM.

end

stringID of the element that end this section. Note this element will be removed from the DOM.

className

stringClass name of the element highlights are wrapped in.

tag

stringTag that will be used to wrap the highlighted words.

Response

void

keepalive

Keep session alive, for example, while editing or creating an article.

keepalive() : 
static deprecated
since

1.5

deprecated

4.0 will be removed in 6.0 Use the webasset manager instead Example: Factory::getApplication()->getDocument()->getWebAssetManager()->useScript('keepalive');

Response

void

multiselect

JavaScript behavior to allow shift select in grids

multiselect( id = 'adminForm') : 
static deprecated
since

1.7

deprecated

4.0 will be removed in 6.0 Use the webasset manager instead Example: Factory::getApplication()->getDocument()->getWebAssetManager()->useScript('multiselect'); Factory::getDocument()->addScriptOptions('js-multiselect', ['formName' => $id]);

Arguments

id

stringThe id of the form for which a multiselect behaviour is to be applied.

Response

void

polyfill

Add javascript polyfills.

polyfill(string|array polyfillTypes = null,  conditionalBrowser = null) : 
static
since

3.7.0

Arguments

polyfillTypes

string|array<string|int, mixed>The polyfill type(s). Examples: event, array('event', 'classlist').

conditionalBrowser

stringAn IE conditional expression. Example: lt IE 9 (lower than IE 9).

Response

void

Properties

loaded

Array containing information for loaded files

static
since

2.5

Type(s)

array<string|int, mixed>