Here is my code:
class Dolphin_Slideshow_Block_Adminhtml_Slideshow_Grid extends Mage_Adminhtml_Block_Widget_Grid
{
public function __construct()
{
parent::__construct();
$this->setId('slideshowGrid');
$this->setDefaultSort('slideshow_id');
$this->setDefaultDir('ASC');
$this->setSaveParametersInSession(true);
$this->setUseAjax(true);
}
}
getGridUrl()
function in grid.php:
public function getGridUrl()
{
return $this->getUrl('*/*/grid', array('_current'=>true));
}
gridAction()
function in controller:
public function gridAction()
{
$this->loadLayout();
$this->getResponse()->setBody(
$this->getLayout()->createBlock('slideshow/adminhtml_slideshow_grid')->toHtml()
);
}
Updates: Now, after so many try...i found if i removed foreach loop from preparecollection method then My Sorting is working....but after doing this....All store views title are not fetch into admin grid .. but there is no problem with english, french
slideshow_id
field is exits in model and second also check compilter is enable or notASC
toasc