Back to Behavior class

Method multiselect

public static void
multiselect
(mixed $id = 'adminForm')
JavaScript behavior to allow shift select in grids
Parameters
  • string $id The id of the form for which a multiselect behaviour is to be applied.
Returns
  • void
Since
  • 1.7
Deprecated
  • 5.0
Class: Behavior
Project: Joomla

Method multiselect - Source code

/**
 * JavaScript behavior to allow shift select in grids
 *
 * @param   string  $id  The id of the form for which a multiselect behaviour is to be applied.
 *
 * @return  void
 *
 * @since   1.7
 * @deprecated 5.0 Use the script directly
 */
public static function multiselect($id = 'adminForm')
{
    // Only load once
    if (isset(static::$loaded[__METHOD__][$id])) {
        return;
    }
    Factory::getDocument()->getWebAssetManager()->useScript('multiselect');
    // Pass the required options to the javascript
    Factory::getDocument()->addScriptOptions('js-multiselect', ['formName' => $id]);
    // Set static array
    static::$loaded[__METHOD__][$id] = true;
}