How to create preview page for custom module like order preview page?












0














I am trying to create a custom module for product quotation related, I am getting grid structure and edit form. Everything is working fine, But I want to preview the quotation data for each like order preview page.



Is there any blog or tutorial for creating a preview page in the custom module.



This is my code



app/code/local/Spritz/Adminquote/controllers/Adminhtml/AdminquoteController.php



class Spritz_Adminquote_Adminhtml_AdminquoteController extends Mage_Adminhtml_Controller_Action{
/**
* View Quotation details
*/
public function viewAction()
{
$this->_title($this->__("Adminquote"));
$this->_title($this->__("Adminquote"));
$this->_title($this->__("View Quotation"));

$id = $this->getRequest()->getParam("quotation_id");
$model = Mage::getModel("adminquote/adminquote")->load($id);

if ($model->getId()) {
Mage::register("adminquote_data", $model);
$this->loadLayout();
$this->_setActiveMenu("adminquote/adminquote");
$this->_addBreadcrumb(Mage::helper("adminhtml")->__("Quotation Manager"), Mage::helper("adminhtml")->__("Quotation Manager"));
$this->_addBreadcrumb(Mage::helper("adminhtml")->__("Quotation Description"), Mage::helper("adminhtml")->__("Quotation Description"));
$this->getLayout()->getBlock("head")->setCanLoadExtJs(true);
$this->_addContent($this->getLayout()->createBlock("adminquote/adminhtml_adminquote_view"));
$this->renderLayout();
}
else {
Mage::getSingleton("adminhtml/session")->addError(Mage::helper("adminquote")->__("Quotation does not exist."));
$this->_redirect("*/*/");
}
}


}



app/code/local/Spritz/Adminquote/Block/Adminhtml/Adminquote/Grid.php



class Spritz_Adminquote_Block_Adminhtml_Adminquote_Grid extends Mage_Adminhtml_Block_Widget_Grid{
public function getRowUrl($row)
{
return $this->getUrl("*/*/view", array("quotation_id" => $row->getId()));
}
}


Using the above code I am getting the empty page for each quotation. In that page, I am getting header text also.



But I don't know how to access template and pass data to that template for body content. Please, anyone, help me to fix this.



Thanks.










share|improve this question





























    0














    I am trying to create a custom module for product quotation related, I am getting grid structure and edit form. Everything is working fine, But I want to preview the quotation data for each like order preview page.



    Is there any blog or tutorial for creating a preview page in the custom module.



    This is my code



    app/code/local/Spritz/Adminquote/controllers/Adminhtml/AdminquoteController.php



    class Spritz_Adminquote_Adminhtml_AdminquoteController extends Mage_Adminhtml_Controller_Action{
    /**
    * View Quotation details
    */
    public function viewAction()
    {
    $this->_title($this->__("Adminquote"));
    $this->_title($this->__("Adminquote"));
    $this->_title($this->__("View Quotation"));

    $id = $this->getRequest()->getParam("quotation_id");
    $model = Mage::getModel("adminquote/adminquote")->load($id);

    if ($model->getId()) {
    Mage::register("adminquote_data", $model);
    $this->loadLayout();
    $this->_setActiveMenu("adminquote/adminquote");
    $this->_addBreadcrumb(Mage::helper("adminhtml")->__("Quotation Manager"), Mage::helper("adminhtml")->__("Quotation Manager"));
    $this->_addBreadcrumb(Mage::helper("adminhtml")->__("Quotation Description"), Mage::helper("adminhtml")->__("Quotation Description"));
    $this->getLayout()->getBlock("head")->setCanLoadExtJs(true);
    $this->_addContent($this->getLayout()->createBlock("adminquote/adminhtml_adminquote_view"));
    $this->renderLayout();
    }
    else {
    Mage::getSingleton("adminhtml/session")->addError(Mage::helper("adminquote")->__("Quotation does not exist."));
    $this->_redirect("*/*/");
    }
    }


    }



    app/code/local/Spritz/Adminquote/Block/Adminhtml/Adminquote/Grid.php



    class Spritz_Adminquote_Block_Adminhtml_Adminquote_Grid extends Mage_Adminhtml_Block_Widget_Grid{
    public function getRowUrl($row)
    {
    return $this->getUrl("*/*/view", array("quotation_id" => $row->getId()));
    }
    }


    Using the above code I am getting the empty page for each quotation. In that page, I am getting header text also.



    But I don't know how to access template and pass data to that template for body content. Please, anyone, help me to fix this.



    Thanks.










    share|improve this question



























      0












      0








      0







      I am trying to create a custom module for product quotation related, I am getting grid structure and edit form. Everything is working fine, But I want to preview the quotation data for each like order preview page.



      Is there any blog or tutorial for creating a preview page in the custom module.



      This is my code



      app/code/local/Spritz/Adminquote/controllers/Adminhtml/AdminquoteController.php



      class Spritz_Adminquote_Adminhtml_AdminquoteController extends Mage_Adminhtml_Controller_Action{
      /**
      * View Quotation details
      */
      public function viewAction()
      {
      $this->_title($this->__("Adminquote"));
      $this->_title($this->__("Adminquote"));
      $this->_title($this->__("View Quotation"));

      $id = $this->getRequest()->getParam("quotation_id");
      $model = Mage::getModel("adminquote/adminquote")->load($id);

      if ($model->getId()) {
      Mage::register("adminquote_data", $model);
      $this->loadLayout();
      $this->_setActiveMenu("adminquote/adminquote");
      $this->_addBreadcrumb(Mage::helper("adminhtml")->__("Quotation Manager"), Mage::helper("adminhtml")->__("Quotation Manager"));
      $this->_addBreadcrumb(Mage::helper("adminhtml")->__("Quotation Description"), Mage::helper("adminhtml")->__("Quotation Description"));
      $this->getLayout()->getBlock("head")->setCanLoadExtJs(true);
      $this->_addContent($this->getLayout()->createBlock("adminquote/adminhtml_adminquote_view"));
      $this->renderLayout();
      }
      else {
      Mage::getSingleton("adminhtml/session")->addError(Mage::helper("adminquote")->__("Quotation does not exist."));
      $this->_redirect("*/*/");
      }
      }


      }



      app/code/local/Spritz/Adminquote/Block/Adminhtml/Adminquote/Grid.php



      class Spritz_Adminquote_Block_Adminhtml_Adminquote_Grid extends Mage_Adminhtml_Block_Widget_Grid{
      public function getRowUrl($row)
      {
      return $this->getUrl("*/*/view", array("quotation_id" => $row->getId()));
      }
      }


      Using the above code I am getting the empty page for each quotation. In that page, I am getting header text also.



      But I don't know how to access template and pass data to that template for body content. Please, anyone, help me to fix this.



      Thanks.










      share|improve this question















      I am trying to create a custom module for product quotation related, I am getting grid structure and edit form. Everything is working fine, But I want to preview the quotation data for each like order preview page.



      Is there any blog or tutorial for creating a preview page in the custom module.



      This is my code



      app/code/local/Spritz/Adminquote/controllers/Adminhtml/AdminquoteController.php



      class Spritz_Adminquote_Adminhtml_AdminquoteController extends Mage_Adminhtml_Controller_Action{
      /**
      * View Quotation details
      */
      public function viewAction()
      {
      $this->_title($this->__("Adminquote"));
      $this->_title($this->__("Adminquote"));
      $this->_title($this->__("View Quotation"));

      $id = $this->getRequest()->getParam("quotation_id");
      $model = Mage::getModel("adminquote/adminquote")->load($id);

      if ($model->getId()) {
      Mage::register("adminquote_data", $model);
      $this->loadLayout();
      $this->_setActiveMenu("adminquote/adminquote");
      $this->_addBreadcrumb(Mage::helper("adminhtml")->__("Quotation Manager"), Mage::helper("adminhtml")->__("Quotation Manager"));
      $this->_addBreadcrumb(Mage::helper("adminhtml")->__("Quotation Description"), Mage::helper("adminhtml")->__("Quotation Description"));
      $this->getLayout()->getBlock("head")->setCanLoadExtJs(true);
      $this->_addContent($this->getLayout()->createBlock("adminquote/adminhtml_adminquote_view"));
      $this->renderLayout();
      }
      else {
      Mage::getSingleton("adminhtml/session")->addError(Mage::helper("adminquote")->__("Quotation does not exist."));
      $this->_redirect("*/*/");
      }
      }


      }



      app/code/local/Spritz/Adminquote/Block/Adminhtml/Adminquote/Grid.php



      class Spritz_Adminquote_Block_Adminhtml_Adminquote_Grid extends Mage_Adminhtml_Block_Widget_Grid{
      public function getRowUrl($row)
      {
      return $this->getUrl("*/*/view", array("quotation_id" => $row->getId()));
      }
      }


      Using the above code I am getting the empty page for each quotation. In that page, I am getting header text also.



      But I don't know how to access template and pass data to that template for body content. Please, anyone, help me to fix this.



      Thanks.







      magento-1.9






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 12 hours ago









      Evince Development

      1,110317




      1,110317










      asked 13 hours ago









      Sudhakar SJ

      177




      177






















          0






          active

          oldest

          votes











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "479"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f256592%2fhow-to-create-preview-page-for-custom-module-like-order-preview-page%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Magento Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f256592%2fhow-to-create-preview-page-for-custom-module-like-order-preview-page%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown