kartik-v / yii2-dynagrid

Turbo charge the Yii 2 GridView with personalized columns, page size, and themes.
http://demos.krajee.com/dynagrid
Other
74 stars 66 forks source link

allowSortSetting => false causes exception #80

Closed dvdkrgr closed 9 years ago

dvdkrgr commented 9 years ago

Setting allowSortSetting to true is working fine for me, but when I'm setting it to false,i get the following exception:

Call to a member function getOrders() on a non-object

  1. in C:\xampp\htdocs\example.com\vendor\kartik-v\yii2-dynagrid\DynaGrid.php

    if ($this->showSort) {
       $this->setToggleButton('sort');
       $model->category = DynaGridStore::STORE_SORT;
       $model->key = $this->_sortKey;
       $model->data = $sort->getOrders();
       $dynagridSort = DynaGridDetail::widget([
           'id' => $this->_sortModalId,
           'model' => $model,
           'toggleButton' => $this->toggleButtonSort,
           'submitMessage' => $this->submitMessage,
           'deleteMessage' => $this->deleteMessage,
           'messageOptions' => $this->messageOptions,
           'deleteConfirmation' => $this->deleteConfirmation,
           'isPjax' => $this->_isPjax
dvdkrgr commented 9 years ago

My composer.json was set to prefer-stable: true This issue is solved with v1.4.4 (unstable) of this plugin, changing this has fixed the issue.