3

I have the following file structure:

community/Sandipan

community/Sandipan/controllers/Adminhtml/ProductfileuploadbackendController.php [1]

I have a template file in the following directory:

design/adminhtml/default/default/template/productfileupload/catalog/product/tab.phtml [2]

My class [1] looks like this:

class Sandipan_Productfileupload_Adminhtml_ProductfileuploadbackendController extends Mage_Adminhtml_Controller_Action {
public method deleteRecordAction() {

}

}

I want to send AJAX request to deleteRecordAction from my template [2], how can I do that? I tried the following:

Mage::helper("adminhtml")>getUrl("adminhtml/productfileuploadbackend/deleteRecord");

But it's not working.

Kristian Vitozev
  • 135
  • 1
  • 1
  • 6

2 Answers2

7

If your module config.xml configure is properly and configure like

<config>
....
    <admin>
        <routers>
            <adminhtml>
                <args>
                    <modules>
                        <Sandipan_Productfileupload before="Mage_Adminhtml">Sandipan_Productfileupload_Adminhtml</Sandipan_Productfileupload>
                    </modules>
                </args>
            </adminhtml>
        </routers>
    </admin>
....    
</config>

Then

Mage::helper('adminhtml')->getUrl('adminhtml/productfileuploadbackend/deleteRecord', ['_secure' => true]);

should work properly

Tim Bezhashvyly
  • 11,575
  • 6
  • 43
  • 73
Amit Bera
  • 77,456
  • 20
  • 123
  • 237
0

You have a typo in function. You should replace the method with function.

Please see the attached screenshot enter image description here

DJ Dev
  • 509
  • 2
  • 7