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(); }
Hi @OleKh,
Can you share why you need that change? (just to understand which problem you need to solve)
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.
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.
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?
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.