Change Liferay Portlet Title in javascript

此生再无相见时 提交于 2019-12-13 03:21:38

问题


Does it possible to change liferay portlet title using javascript? For example I have a couple of divs, one of them is shown, other are hidden. I press the button and different div is going to be shown. Portlet title must be name of that div.

There is portletTitleEdit function in util.js, but seems it's not the function I need, because it tries to save the portletTitle via ajax. I need just to substitute the title.


回答1:


You could add some custom javascript as jQuery is available something like

$('#idOfPortlet').find('.portlet-title').html('new title'); would suffice. This would narrow this down to a particular portlet you could include this using the liferay-portlet.xml file in your portlet



来源:https://stackoverflow.com/questions/5582669/change-liferay-portlet-title-in-javascript

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!