protected function isListOrderDraggable($totalCount, $currentCount)
    {
        $info = $this->getModelInformation();

        if ( ! $info->list->orderable) {
            return false;
        }

        $showTopParentsOnly = $this->showsTopParentsOnly();
        $scopedRelation     = $info->list->order_scope_relation;

        if ($showTopParentsOnly || $this->hasActiveListParent()) {

            // Check if the listify scope relation matches on the actively scoped list parent relation

            if ( ! $scopedRelation) {
                return false;
            }

            if ($showTopParentsOnly) {

                if ($scopedRelation != $info->list->default_top_relation) {
                    return false;
                }

            } else {
                /** @var ListParentData $parent */
                $parent = head($this->listParents);

                if ($scopedRelation != $parent->relation) {
                    return false;
                }
            }

        } elseif ($scopedRelation) {
            // If there is a listify relation scope and the list is not scoped at all, never draggable
            return false;
        }

        $hasScope   = (bool) $this->getActiveScope();
        $hasFilters = ! empty($this->getActiveFilters());

        return  $info->list->getOrderableColumn() === $this->getActualSort()
            &&  (   $totalCount == $currentCount
                ||  ( ! $hasScope  && ! $hasFilters)
                );
    }
protected function isListOrderDraggable($totalCount, $currentCount)
    {
        $info = $this->getModelInformation();

        if ( ! $info->list->orderable) {
            return false;
        }

        $showTopParentsOnly = $this->showsTopParentsOnly();
        $scopedRelation     = $info->list->order_scope_relation;

        if ($showTopParentsOnly || $this->hasActiveListParent()) {

            // Check if the listify scope relation matches on the actively scoped list parent relation

            if ( ! $scopedRelation) {
                return false;
            }

            if ($showTopParentsOnly) {

                if ($scopedRelation != $info->list->default_top_relation) {
                    return false;
                }

            } else {
                /** @var ListParentData $parent */
                $parent = head($this->listParents);

                if ($scopedRelation != $parent->relation) {
                    return false;
                }
            }

        } elseif ($scopedRelation) {
            // If there is a listify relation scope and the list is not scoped at all, never draggable
            return false;
        }

        $hasScope   = (bool) $this->getActiveScope();
        $hasFilters = ! empty($this->getActiveFilters());

        return  $info->list->getOrderableColumn() === $this->getActualSort()
            &&  (   $totalCount == $currentCount
                ||  ( ! $hasScope  && ! $hasFilters)
                );
    }
protected function isListOrderDraggable ( $ totalCount , $ currentCount ) { $ info = $ this -> getModelInformation ( ) ; if ( ! $ info -> list -> orderable ) { return false ; } $ showTopParentsOnly = $ this -> showsTopParentsOnly ( ) ; $ scopedRelation = $ info -> list -> order_scope_relation ; if ( $ showTopParentsOnly || $ this -> hasActiveListParent ( ) ) { // Check if the listify scope relation matches on the actively scoped list parent relation if ( ! $ scopedRelation ) { return false ; } if ( $ showTopParentsOnly ) { if ( $ scopedRelation != $ info -> list -> default_top_relation ) { return false ; } } else { /** @var ListParentData $parent */ $ parent = head ( $ this -> listParents ) ; if ( $ scopedRelation != $ parent -> relation ) { return false ; } } } elseif ( $ scopedRelation ) { // If there is a listify relation scope and the list is not scoped at all, never draggable return false ; } $ hasScope = ( bool ) $ this -> getActiveScope ( ) ; $ hasFilters = ! empty ( $ this -> getActiveFilters ( ) ) ; return $ info -> list -> getOrderableColumn ( ) === $ this -> getActualSort ( ) && ( $ totalCount == $ currentCount || ( ! $ hasScope && ! $ hasFilters ) ) ; }
Returns whether, given the current circumstances, the list may be ordered by dragging rows.

@param int  $totalCount
@param int  $currentCount
@return bool
Returns whether given the current circumstances the list may be ordered by dragging rows .