arogachev / yii2-sortable

Sortable ActiveRecord for Yii 2 framework
Other
17 stars 9 forks source link

Doesn't work without url rewrite #32

Open maxxer opened 6 years ago

maxxer commented 6 years ago

The $baseUrl property assumes /sort/ url is accessible, but if you don't have enablePrettyUrl = true it won't work

maxxer commented 6 years ago

More than this with the current behavior it won't work if the Yii app is not in the root of the webserver. I've changed the OrgSortableColumn initialization this way:

        $this->_origSortableColumn = Yii::createObject([
            'class' => OrigSortableColumn::className(),
            'grid' => $this->grid,
            'template' => $this->template,
            'buttons' => $this->buttons,
            'gridContainerId' => $this->gridContainerId,
            'confirmMove' => $this->confirmMove,
            'baseUrl' => Url::to([$this->baseUrl])."/",
        ]);