Open danhammari opened 10 years ago
Here is the workaround I am using in the zend controller's init() method to suppress the division by zero error that occurs when "perPage" is set to zero and "start" is specified:
// mitigate zfdatagrid perPage/start conflict
if( $this->getRequest()->getParam( 'perPage', false ) === '0' ){
if( $this->getRequest()->getParam( 'start', false ) !== false ){
$this->getRequest()->setParam( 'start', 0 );
}
}
Here is the warning I get when perPage is set to zero and start is not zero:
Warning: Division by zero in \Bvb\Grid\Deploy\Table.php on line 1358
I am using Bvb_Grid version 0.8
When showing all records in a grid, shouldn't the grid ignore the record start value? I have added a pagination control to the grid so a user can select the number of items to show per page. This pagination control includes the value zero, which should show all records. However, if a user selects the zero value on the pagination control when not on the first page of the grid, the start value is retained and the grid shows all records except for those that occurred before the start value.
I would think that the grid should automatically recognize that all records are being asked for and ignore the start value. Or is there some way to suppress the start value so it isn't passed in the get values of the URL when selecting a pagination interval value of zero? I have gone through the documentation, but have not found a way to override the start value parameter.