API16:JHtmlGrid/behavior
From Joomla! Documentation
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Contents |
Syntax
static behavior()
Defined in
libraries/joomla/html/html/grid.php
Importing
jimport( 'joomla.html.html.grid' );
Source Body
static function behavior() { static $loaded; if (!$loaded) { // Build the behavior script. $js = ' window.addEvent(\'domready\', function(){ actions = $$(\'a.move_up\'); actions.combine($$(\'a.move_down\')); actions.combine($$(\'a.grid_true\')); actions.combine($$(\'a.grid_false\')); actions.combine($$(\'a.grid_trash\')); actions.each(function(a){ a.addEvent(\'click\', function(){ args = JSON.decode(this.rel); listItemTask(args.id, args.task); }); }); $$(\'input.check-all-toggle\').each(function(el){ el.addEvent(\'click\', function(){ if (el.checked) { document.id(this.form).getElements(\'input[type=checkbox]\').each(function(i){ i.checked = true; }) } else { document.id(this.form).getElements(\'input[type=checkbox]\').each(function(i){ i.checked = false; }) } }); }); });'; // Add the behavior to the document head. $document = & JFactory::getDocument(); $document->addScriptDeclaration($js); $loaded = true; } }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
