Adds an action to be performed when clicking a row.

Will stack if called multiple times, in order.
The first action that is permitted, is performed.

@param string $action    action alias
@return ModelList|$this
495343
public function rowClickAction(string $action): ModelList
    {
        if ( ! array_has($this->main, 'default_action')) {
            $this->main['default_action'] = [];
        }

        $this->main['default_action'][] = $action;

        return $this;
    }
1148725
public function setAction($action) {
        if (empty($action)) {
            throw new \Exception("Action cannot be empty", 0, null); //todo: create error code
        } else if (!is_string($action)) {
            throw new \Exception("Action must be a string", 0, null); //todo: create error code
        } else {
            $this->action = $action;
        }
    }
781070
public function tap(callable $action)
    {
        return new Enumerator(
            function () use($action) {
                foreach ($this->each() as $k => $v) {
                    call_user_func($action, $v, $k);
                    yield $k => $v;
                }
            }
        );
    }
1207688
public function addActions(array $actions): self
    {
        foreach ($actions as $action) {
            $this->addAction($action);
        }

        return $this;
    }
662276
public function setAction($action)
    {
        if (!$this->validateAction($action)) {
            throw new \RuntimeException("$action: is not a valide Action.");
        }

        $this->action = $action;

        return $this;
    }
781662
protected function addTableAction($action, $row, $btn)
    {
        if (empty($this->tableActions)) {
            $this->tableActions = new Collection();
        }
        $path = uri();
        Event::fire('datatables:' . $path . ':before.action.' . $action, [$this->tableActions, $row]);
        Event::fire(new BeforeTableAction($path, $action, $row, $this->tableActions));
        $this->tableActions->push($btn);
        Event::fire('datatables:' . $path . ':after.action.' . $action, [$this->tableActions, $row]);
        Event::fire(new AfterTableAction($path, $action, $row, $this->tableActions));
        Event::fire('datatables.' . get_class($this) . '.after.action.' . $action, [$this->tableActions, $row]);
        return $this;
    }
946954
public function registerActionAlias($alias, $action)
    {
        $alias = strtolower($alias);

        if (! in_array($alias, $this->getActions()))  {
            $this->_action_map[$alias] = $action;
        }

        //Force reload of the actions
        $this->_actions = array_unique(array_merge($this->_actions, array_keys($this->_action_map)));

        return $this;
    }
300949
public function action(string $action, string $controller)
    {
        $this->options['actions'][strtolower($action)] = $controller;

        return $this;
    }
550236
public function Link($action = null)
    {
        if (!$action) {
            $action = $this->step;
        }

        return $this->dataRecord->RelativeLink($action);
    }
876636
public function Link($action = null)
    {
        if (!$action
            && Member::currentUserID()
            && !$this->AllowProfileEditing
            && $this->CanAddMembers()
        ) {
            $action = 'add';
        }

        return parent::Link($action);
    }
1263497
protected function addAction($action)
    {
        $args = func_get_args();
        array_shift($args);
        $this->actionQueue []= array('action' => $action, 'args' => $args);
    }
946013
public function addAction($action, $callback)
    {
        if (!is_callable($callback)) {
            throw new \Exception('Callback is not callable.');
        }

        $this->getLogger()->info('[SERVICE] Registering: '.$action);

        $this->actions[$action] = $callback;

        return $this;
    }
506466
public function dispatch($action)
    {
        // Notify helpers of action preDispatch state
        $this->_helper->notifyPreDispatch();

        $this->preDispatch();
        Kwf_Benchmark::checkpoint('Action::preDispatch');
        if ($this->getRequest()->isDispatched()) {
            if (null === $this->_classMethods) {
                $this->_classMethods = get_class_methods($this);
            }

            // preDispatch() didn't change the action, so we can continue
            if ($this->getInvokeArg('useCaseSensitiveActions') || in_array($action, $this->_classMethods)) {
                if ($this->getInvokeArg('useCaseSensitiveActions')) {
                    trigger_error('Using case sensitive actions without word separators is deprecated; please do not rely on this "feature"');
                }
                $this->$action();
            } else {
                $this->__call($action, array());
            }
            Kwf_Benchmark::checkpoint('Action::action');

            $this->postDispatch();
            Kwf_Benchmark::checkpoint('Action::postDispatch');
        }

        // whats actually important here is that this action controller is
        // shutting down, regardless of dispatching; notify the helpers of this
        // state
        $this->_helper->notifyPostDispatch();
    }
743451
public function apply(callable $action)
    {
        foreach ($this->each() as $k => $v) {
            call_user_func($action, $v, $k);
        }
    }
1338908
public function addAction(array $action)
    {
        $actions = $this->getAction();

        $actions[] = $action;

        return $this->setAction($actions);
    }
344953
public function appendAction(FrenchFrogs\Form\Element\Button $action)
    {
        $this->actions[] = $action;
        return $this;
    }
533731
public function add_primary_action($action) {
        if ($action instanceof action_link || $action instanceof pix_icon) {
            $action->attributes['role'] = 'menuitem';
            if ($action instanceof action_menu_link) {
                $action->actionmenu = $this;
            }
        }
        $this->primaryactions[] = $action;
    }