2

i'm writing a module to retrieve the data from a table (i manually created it by using phpmyadmin), but i don't know how to access it in grid.php

<?php
class TempName_AdminLog_Block_Adminhtml_Sales_Order_Grid extends Mage_Adminhtml_Block_Widget_Grid
{
    public function __construct()
    {
        parent::__construct();
        $this->setId('tempname_admninlog_grid');
        $this->setDefaultSort('increment_id');
        $this->setDefaultDir('DESC');
        $this->setSaveParametersInSession(true);
        $this->setUseAjax(true);
    }
    protected function _prepareCollection()
    {
        ***$collection = Mage::getResourceModel('sales/order_collection')***

        return $this;
    }
    protected function _prepareColumns()
    {

    }
    public function getGridUrl()
    {

    }
}

how to access the table "admin_log" in _prepareCollection method? Anyone knows what i actually have to do?

3
  • hkinterview,are you want to append admin_log table in Sales order collection grid,or, you want to show admin log indivisual grid
    – Amit Bera
    Apr 11, 2014 at 4:22
  • i want to build a custom grid displaying the database data.
    – hkguile
    Apr 11, 2014 at 5:17
  • then you must create an custom module which has own model
    – Amit Bera
    Apr 11, 2014 at 5:22

1 Answer 1

0

you can learn from this post, they provide a nice tutorial:

http://excellencemagentoblog.com/admin-part1-series-magento-admin-forms-grids-controllers-tabs
http://excellencemagentoblog.com/admin-part2-series-magento-admin-forms-grids-controllers-tabs
http://excellencemagentoblog.com/module-development-series-magento-admin-module-part3
http://excellencemagentoblog.com/magento-admin-form-field

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.