Wednesday, May 14, 2014

How to change Liferay Portlet title with jQuery

In some cases, we might want to change the Portlet title, So that the title is more meaningful the the Portlet content.
eg. screen navigates from search page to maintenance page.


$('#idOfDeployedPortlet').find('.portlet-title-text').html('new title');


idOfDeployedPortlet - portlet id deployed in Liferay, if you do not know how to get the deployed portlet id, please refer this post.
new title - Title to be passed in for the target page.

This can be done with AUI embedded in Liferay as well with the following line of code.
But I have no luck to get it works.
A.one('#portletId .portlet-title').setContent('new title');

reference: http://stackoverflow.com/questions/7551639/change-portlet-title-from-code-in-liferay-without-jquery


Done!!

LinkWithin

Related Posts Plugin for WordPress, Blogger...