>Increase Number of Records in Magento Admin Grid

Increase Number of Records in Magento Admin Grid

3 min read

To increase the number of records displayed in the backend grid (used for cases of too many records), we can edit in the template grid.phtml (App/design/adminhtml/default/default/template/widget/grid.phtml. Currently, the maximum number is only 200 records.

Solution 1 (recommended)

Step 1: Create a folder: app/design/adminhtml/default/

Step 2: Create the folder template in app/design/adminhtml/default/custom_name

Step 3: Create the folder widget in app/design/adminhtml/default/custom_name/template

Step 4: Copy file grid.phtml from app/design/adminhtml/default/default/template/widget/grid.phtml to app/design/adminhtml/default/custom_name/template/widget

Step 5:  Add the following code right after the code string (line 82 –> line86) of the file grid.phtml

<option value="20"<?php if($this->getCollection()->getPageSize()= =20): ?> selected="selected"<?php endif; ?>>20</option>
<option value="30"<?php if($this->getCollection()->getPageSize()==30): ?> selected="selected"<?php endif; ?>>30</option>
<option value="50"<?php if($this->getCollection()->getPageSize()==50): ?> selected="selected"<?php endif; ?>>50</option>
<option value="100"<?php if($this->getCollection()->getPageSize()==100): ?> selected="selected"<?php endif; ?>>100</option>
<option value="200"<?php if($this->getCollection()->getPageSize()==200): ?> selected="selected"<?php endif; ?>>200</option>
value: ( if display  up to 500 records)
<option value="500"<?php if($this->getCollection()->getPageSize()==500): ?> selected="selected"<?php endif; ?>>500</option>

Step 6: In filelocal.xml (app/etc/local.xml), add the following lines:

<config>
         <stores>
                  <admin>
                               <design>
                                        <theme>
                                                 <default>custom_name</default>
                                        </theme>
                              </design>
                  </admin>
         </stores>
</config>

 –> Now you can check maximum number of records displayed IN backend grid again to see the changes you’ve made. 

Solution 2

(not recommended because this way makes some changes in Magento default file so these changes will be lost if we upgrade Magento version)

In file grid.phtml in app/design/adminhtml/default/default/template/widget/grid.phtml, add the following code right after the code string (line 82 –> line 86)

<option value="20"<?php if($this->getCollection()->getPageSize()==20): ?> selected="selected"<?php endif; ?>>20</option>
<option value="30"<?php if($this->getCollection()->getPageSize()==30): ?> selected="selected"<?php endif; ?>>30</option>
<option value="50"<?php if($this->getCollection()->getPageSize()==50): ?> selected="selected"<?php endif; ?>>50</option>
<option value="100"<?php if($this->getCollection()->getPageSize()==100): ?> selected="selected"<?php endif; ?>>100</option>
<option value="200"<?php if($this->getCollection()->getPageSize()==200): ?> selected="selected"<?php endif; ?>>200</option>
value: ( if display up to 500 records )
<option value="500"<?php if($this->getCollection()->getPageSize()==500): ?> selected="selected"<?php endif; ?>>500</option>

 –> Recheck the number of records can be displayed in backend grid

< Previous Post
Next Post >