cancel
Showing results for 
Search instead for 
Did you mean: 

Reload Category Page in Admin without Ajax

Reload Category Page in Admin without Ajax

I need advice how to reload Category page without Ajax after click on Save Button.

1. Try to change 'onclick' useAjax parameter to false I get response in json format

  

     // Reset button
        if (!$category->isReadonly()) {
            $resetPath = $categoryId ? '*/*/edit' : '*/*/add';
            $this->setChild('reset_button',
                $this->getLayout()->createBlock('adminhtml/widget_button')
                    ->setData(array(
                        'label'     => Mage::helper('catalog')->__('Reset'),
                        'onclick'   => "categoryReset('".$this->getUrl($resetPath, array('_current'=>true))."',false)"
                    ))
            );
        }

 

2. Try to reload Category page using location.reload()  and reload page to Root Category

 

              if (response.messages){
                                $(messagesContainer).update(response.messages);
                                location.reload();
                            }

 

5 REPLIES 5

Re: Reload Category Page in Admin without Ajax

Hi @OleKh,

 

Can you share why you need that change? (just to understand which problem you need to solve)

Re: Reload Category Page in Admin without Ajax

Hi, Thanks for reply. I create module and have added new Category Tab and it uploads images using core product gallery code. Product.Gallery = Class.create();  With some modification it works on upload and save but it gives me some errors when I try to delete image and others. On product edit page the page is reloaded after saving. 

Re: Reload Category Page in Admin without Ajax

For example, if i have 2 images in gallery and I mark 1 image as Remove and I push Save button, gallery content updated after Saving and I have 1 image, but when I try to upload new image without reloading page, it generates me 2 new images (Rows) instead of 1 image. After js debugging I found that after Save Category Image was deleted and this.imageFile2id has element that was deleted and object this.imageFile2id does not refreshed. Only if Category Page reload after saving it works.

Re: Reload Category Page in Admin without Ajax

Hi @OleKh,

 

I understand the problem but without seeing the whole code to be able to test or debug the code I can't say much. Sorry.

I guess your problem is you're deleting the image after the category is saved and loaded again? And that's why the DOM is created with an extra row?

 

Re: Reload Category Page in Admin without Ajax

Hi, Damian, thanks for reply. 

 

I fixed it on client side by updating incorrect data after Category was saved via Ajax. So reload page does not need already.