Closed GoogleCodeExporter closed 9 years ago
Hi,
It make sense $grid->setRecordsPerPage overwrite global set at grid.ini.
However, isset($this->_recordsPerPage) will always return true because is set a
default value:
protected $_recordsPerPage = 15;
The solution can be set $_recordsPerPage as null. In the code verify if
$_recordsPerPage still null (no var set at grid.ini neither by
$grid->setRecordsPerPage) and set a default value.
Best Regards
Ivo Monteiro
Original comment by ivomonte...@gmail.com
on 17 Mar 2012 at 10:41
Hi,
All is working as expected. After viewing the code you only must call
$grid->setRecordsPerPage() after $grid->setSource()/$grid->query().
Please, can you verify where you are calling $grid->setRecordsPerPage()?
Best Regards
Ivo Monteiro
Original comment by ivomonte...@gmail.com
on 18 Mar 2012 at 11:12
Hi,
confirmed, it works when I call $grid->setRecordsPerPage after $grid->setSource.
This should be in the documentation!
Otherwise I think this this should be changed, in my mind the more logical way
to handle this is: configure the grid first THEN put data into the grid and
output it.
Also, other config options, e.g. setNoOrder, updateColumn, etc. etc. ALL work
*before* $grid->setSource so why should only one option work *after* that??
Kind regards
Original comment by buegelfa...@gmail.com
on 19 Mar 2012 at 10:40
Hi,
I prefer use setSource() at first and then set all options. This also happen in
ZFDataGrid example (check siteController.php).
I agree with you, this info should be in documentation.
Best Regards
Ivo Monteiro
Original comment by ivomonte...@gmail.com
on 19 Mar 2012 at 6:57
Original issue reported on code.google.com by
buegelfa...@gmail.com
on 15 Mar 2012 at 2:41