Refresh an asset with AJAX
Besides sending DeliveryType DELIVERY_TYPE_ASSET in values when posting with ajax what should I do in order to be able to refresh the content of a specific asset?
First example (question): first line of dashboard/views/setting/index.php is
$this->RenderAsset('Messages');
So, how can I refresh the asset 'Messages' without refreshing the view 'index'?
Second example (question): the asset container 'Panel' is usually full of modules. How can I refresh the content of a specific one?
Best Answer
-
Todd Vanilla Staff
We don't currently have a way to pick individual assets or modules in a standardized way.
To grab a module you can usually go through the module controller. So as an example you could do the following:
$('.BoxCategories').get(gdn.url('/module/categoriesmodule?DeliveryType=VIEW'));
The message module is a bit tougher since I think it needs to know the page context to know what messages to render. This would be a good extension to program.
0
Answers
We don't currently have a way to pick individual assets or modules in a standardized way.
To grab a module you can usually go through the module controller. So as an example you could do the following:
The message module is a bit tougher since I think it needs to know the page context to know what messages to render. This would be a good extension to program.