Grido\Components\Operation::addCheckers PHP Метод

addCheckers() публичный Метод

public addCheckers ( Container $container )
$container Nette\Forms\Container
    public function addCheckers(\Nette\Forms\Container $container)
    {
        $items = $this->grid->getData();
        $primaryKey = $this->getPrimaryKey();
        foreach ($items as $item) {
            try {
                $primaryValue = $this->grid->getProperty($item, $primaryKey);
                if (!isset($container[$primaryValue])) {
                    $container->addCheckbox(Helpers::formatColumnName($primaryValue))->controlPrototype->title = $primaryValue;
                }
            } catch (\Exception $e) {
                throw new Exception('You should define some else primary key via $grid->setPrimaryKey() ' . "because currently defined '{$primaryKey}' key is not suitable for operation feature.");
            }
        }
    }