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.

1
  • can you please add config.xml code in question
    – Amit Bera
    Commented Oct 8, 2015 at 17:12

2 Answers 2

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

1
0

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

Please see the attached screenshot enter image description here

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.