简体   繁体   中英

change portlet title from code in Liferay without Jquery

I'm having solution to change title of portlet through JQuery.

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

But we dont want to use JQuery in our project. Is there any solution to change title of portlet using YUI or anyother thing through code?

Thanks in Advance.

Regards, Mayur Patel

If the version of Liferay you're on is using YUI 3, then this aught to do it:

Y.one('#idOfPortlet .portlet-title').setContent('new title');

I'm not sure if Liferay exposes the YUI instance as Y, or if they wrap it in AUI and make it A.

您可以通过使用以下代码来做到这一点-

document.getElementsByClassName('.portlet-title')[0].content = 'something else as title'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM