在没有Jquery的情况下从Liferay中的代码更改portlet标题 [英] change portlet title from code in Liferay without Jquery

查看:68
本文介绍了在没有Jquery的情况下从Liferay中的代码更改portlet标题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在通过JQuery更改Portlet标题的解决方案.

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

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

但是我们不想在我们的项目中使用JQuery. 有什么解决方案可以使用YUI或通过代码通过其他方式更改portlet的标题?

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?

预先感谢.

关于, Mayur Patel

Regards, Mayur Patel

推荐答案

如果您使用的Liferay版本使用的是YUI 3,则可以这样做:

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');

我不确定Liferay是否将YUI实例公开为Y,或者是否将其包装在AUI中并设为A.

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

这篇关于在没有Jquery的情况下从Liferay中的代码更改portlet标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆