Behavior
Utility class for JavaScript behaviors
since |
1.5 |
---|---|
package |
Joomla CMS |
Methods
calendartranslation
Internal method to translate the JavaScript Calendar
calendartranslation() :
since |
1.5 |
---|
Response
string
JavaScript that translates the object
combobox
Add unobtrusive JavaScript support for a combobox effect.
combobox() :
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() :
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() :
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') :
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
string
ID 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
string
ID of the element that end this section. Note this element will be removed from the DOM.- className
string
Class name of the element highlights are wrapped in.- tag
string
Tag that will be used to wrap the highlighted words.
Response
void
keepalive
Keep session alive, for example, while editing or creating an article.
keepalive() :
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') :
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
string
The 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) :
since |
3.7.0 |
---|
Arguments
- polyfillTypes
string|array<string|int, mixed>
The polyfill type(s). Examples: event, array('event', 'classlist').- conditionalBrowser
string
An IE conditional expression. Example: lt IE 9 (lower than IE 9).
Response
void
Properties
loaded
Array containing information for loaded files
since |
2.5 |
---|
Type(s)
array<string|int, mixed>