开发者

change portlet title from code in Liferay without Jquery

开发者 https://www.devze.com 2023-04-07 05:54 出处:网络
I\'m having solution to change title of portlet through JQuery. $(\'#idOfPortlet\').find(\'.portlet-title\').html(\'n开发者_StackOverflowew title\');

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

$('#idOfPortlet').find('.portlet-title').html('n开发者_StackOverflowew 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.


You can do so, by using this code -

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

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号