admin module: pagination in grid

Please LogIn to Reply!

Post By: admin | 26-01-2012 06:35 Reply

 

The pagination in grid is not working properly in my admin module.when I click on the next page link it produces a nested table(the screenshot image for this is attached) and the page hangs , showing the message “please wait”. when I refresh the page then it goes on the next page. so pagination happens but with a break(the page hangs in between).

I am attaching the screenshot of the problem page. Any help would be greatly appreciated.

 

hello,

Did you found any solution to this??

 Signature 

Trying is the only option, coz m just an abecedarian

 

i think inside you customGrid.php bydefault Grid.php you forget method getGridUrl()
add this code

public function getGridUrl()
    
{
        
return $this->getUrl('*/*/grid', array('_current'=>true));
    
}

if not working and if you inside firefox go to tools->webdevelper->Error Console
and copy the message errors and paste here

 Signature 

Founder of magento arab community http://arabgento.com/
dev (magento zend symfony1.4 symfony2 )
des 2D 3D
arab frensh english

 

Thanks,

No it is there.

I have rendered the customer grid for my extension.

But the paging needs to be reload the page because i am getting my functionality to work on the basis of url

if i add geturl it makes my href like “ajax=true” in the end

and hence the whole css got wrong.

Can i refresh the page by making ajax false for my extension only??

Thanks in Advance

 Signature 

Trying is the only option, coz m just an abecedarian

 

yes in constructor of your grid use
$this->setUseAjax(false);

public function __construct()
  
{
      parent
::__construct();
      
$this->setId('r301Grid');
      
$this->setDefaultSort('r301_id');
      
$this->setDefaultDir('ASC');
//is here
      
$this->setUseAjax(true);
      
$this->setSaveParametersInSession(true);
  
}

 Signature 

Founder of magento arab community http://arabgento.com/
dev (magento zend symfony1.4 symfony2 )
des 2D 3D
arab frensh english

 

I already used setajax true

But havne not included $this->setDefaultDir(’ASC’);
Just added it
Just uploaded it , lets see if it works.
Thanks in advance

 Signature 

Trying is the only option, coz m just an abecedarian

 

No it’s still coming up with double.

and i am getting “setajaxtrue” in my link that i am using , when i am paginating, it also ruins the css

I am stuck from the past 2 months in it.

 Signature 

Trying is the only option, coz m just an abecedarian

 

If i click on pagination button , refreshing the page solves my problem.

Can i refresh my browser on next.previous click

Thanks in advance smile

 Signature 

Trying is the only option, coz m just an abecedarian

 

i have easy solution
in you grid php add ligne of phtml output

public function __construct()
  
{
      parent
::__construct();
      
$this->setId('r301g');
    
//this is the ligne
      
$this->setTemplate('r301/grid.phtml');
      
$this->setDefaultSort('r301_id');
      
$this->setDefaultDir('ASC');
      
$this->setUseAjax(true);
      
$this->setSaveParametersInSession(true);
  
}

and inside grid.phtml’
you can use js function

location.reload(true);
inside grid.phtml you have 2 code for pagination
for example in ligne 65 convert from
<a href="#" title="<?php echo $this->__('Previous page') ?>" onclick="<?php echo $this->getJsObjectName() ?>.setPage('<?php echo ($_curPage-1) ?>');return false;"><img src="<?php echo $this->getSkinUrl('images/pager_arrow_left.gif') ?>" alt="Go to Previous page" class="arrow"/></a>

to

<a href="#" title="<?php echo $this->__('Previous page') ?>" onclick="<?php echo $this->getJsObjectName() ?>.setPage('<?php echo ($_curPage-1) ?>');location.reload(true);"><img src="<?php echo $this->getSkinUrl('images/pager_arrow_left.gif') ?>" alt="Go to Previous page" class="arrow"/></a>

and ligne 73 to

<a href="#" title="<?php echo $this->__('Next page') ?>" onclick="<?php echo $this->getJsObjectName() ?>.setPage('<?php echo ($_curPage+1) ?>');location.reload(true);"><img src="<?php echo $this->getSkinUrl('images/pager_arrow_right.gif') ?>" alt="Go to Next page" class="arrow"/></a>

and ligne 81 to

<select name="<?php echo $this->getVarNameLimit() ?>" onchange="<?php echo $this->getJsObjectName() ?>.loadByElement(this);location.reload(true);">

it’s not very very nice solution but is work

 Signature 

Founder of magento arab community http://arabgento.com/
dev (magento zend symfony1.4 symfony2 )
des 2D 3D
arab frensh english

 

Ok, it looks like you want me to render only the grid from the product listing and not the pagination along with it.

And then add the admin pagination code into my .php file.

Sounds good. Will let you know.

I want this extension to work properly.

Thanks a lot in advance smile

 Signature 

Trying is the only option, coz m just an abecedarian

 

I figured a different way out, any way thanks for your reply..

 Signature 

Trying is the only option, coz m just an abecedarian

`Reply Or Comment!
Please LogIn to Reply!