Closed akorinek closed 9 years ago
The dynagrid is used to set a custom pagesize or sort. It seems you are disabling that functionality? Then why do you need a Dynagrid (and not a normal yii2-grid) - is it just for the column realignment?
It's for column realignment, export and so on. Also, it would be nice from a reusable code standpoint not to have to mix yii gridviews with your gridviews. Also the styling is a bit different between the two.
Export is a yii2-grid functionality.
Dynagrid is used for realigning columns, setting and saving custom sort, setting and saving custom pagesize and save filters.
The way its designed it needs some code rehaul to support disabling of some of the above functionality. Will need to probably look at it later when I get time.
Any updates on this one? I want to display a DynaGrid for the filters, column realignment and so on. But it should display all the data without any pagination. Like @akorinek said setting pagination to 'false' will cause an error.
Disabling pagination is another issue. Please raise one. This can be taken up as an enhancement and will include this when I get time.
Refer enhancement #59. You can now set pagesize to 0
from the dynagrid configuration form to show all rows on one page.
If you want to disable pagination for all -- set Module::defaultPageSize
to 0
.
New enhancements added via #60 and #61.... you can now set pagination
and sort
to false
for gridOptions['dataProvider']` to disable pagination and sort for the grid.
Hi... I am using Export menu and Pjax. I am having more than 1000 records. In records per page , I cant able to selct 50,100,200. Only 20 records are displaying so in output Excel I am getting only 20 records
I'm trying to disable sort and pagination, as documented here: http://www.yiiframework.com/doc-2.0/yii-data-basedataprovider.html#$pagination-detail
If I use a yii2 gridview, this works, in a dynagrid this throws an error. Here is the code:
$SampleSearchModel = new SampleSearch(); $searchparam = ArrayHelper::Merge(Yii::$app->request->queryParams, ['SampleSearch' => ['job_id' => $id]]); $SampleDataProvider = $SampleSearchModel->search($searchparam); $SampleDataProvider->pagination = false;
Gives the following error: Creating default object from empty value
Dynagrid.php line 877: $pagination->pageSize = $this->_pageSize;
The same with sort:
Call to a member function getOrders() on boolean Dynagrid.php line 999: $model->data = $this->gridOptions['dataProvider']->getSort()->getOrders();