src/Integration/Subcolumns.php
public function hookIsVisibleElement(\Model $model, $isVisible)
    {
        if (static::isActive() && (
            ($model->getTable() == 'tl_module' && $model->type == 'subcolumns') ||
            $model->getTable() == 'tl_content' && ($model->type == 'colsetStart' ||
            $model->type == 'colsetPart'
        ))) {
            if ($model->type == 'colsetPart') {
                $modelClass = get_class($model);
                $parent     = $modelClass::findByPk($model->sc_parent);
                $type       = $parent->sc_type;
                $gridId     = $parent->bootstrap_grid;
            } else {
                $type   = $model->sc_type;
                $gridId = $model->bootstrap_grid;
            }

            try {
                $this->updateSubcolumnsDefinition($gridId, $type);
            } catch (\Exception $e) {
                // Do not throw the exception in the frontend. If nothing could fetched the fallback is used.
            }
        }

        return $isVisible;
    }
public function hookIsVisibleElement(\Model $model, $isVisible)
    {
        if (static::isActive() && (
            ($model->getTable() == 'tl_module' && $model->type == 'subcolumns') ||
            $model->getTable() == 'tl_content' && ($model->type == 'colsetStart' ||
            $model->type == 'colsetPart'
        ))) {
            if ($model->type == 'colsetPart') {
                $modelClass = get_class($model);
                $parent     = $modelClass::findByPk($model->sc_parent);
                $type       = $parent->sc_type;
                $gridId     = $parent->bootstrap_grid;
            } else {
                $type   = $model->sc_type;
                $gridId = $model->bootstrap_grid;
            }

            try {
                $this->updateSubcolumnsDefinition($gridId, $type);
            } catch (\Exception $e) {
                // Do not throw the exception in the frontend. If nothing could fetched the fallback is used.
            }
        }

        return $isVisible;
    }
The isVisibleElement hook is used to dynamically load the grid definitions from the database.

Known limitation: If being logged in in the backend and frontend preview is used with show all elements
it does not work!

@param \Model $model     The row model.
@param bool   $isVisible The current visible state.

@return bool

@SuppressWarnings(PHPMD.Superglobals)