This wiki does not contain official documentation and is currently deprecated and read only. Please try reading the documentation on the Liferay Developer Network, the new site dedicated to Liferay documentation. DISCOVER Build your web site, collaborate with your colleagues, manage your content, and more. DEVELOP Build applications that run inside Liferay, extend the features provided out of the box with Liferay's APIs. DISTRIBUTE Let the world know about your app by publishing it in Liferay's marketplace. PARTICIPATE Become a part of Liferay's community, meet other Liferay users, and get involved in the open source project. « Torna a テーマの概要
テーマでJavaScriptの使用
LiferayにはAlloyというJavaScriptライブラリが含まれています。AlloyはYahooのYUI3フレームワークを拡張したフレームワークです。開発者はテーマでこのフレームワークを利用することができます。main.jsファイルに以下の3つのJavaScriptコールバック関数が含まれています:
AUI().ready(
function() {
}
);
Liferay.Portlet.ready(
/*
This function gets loaded after each and every portlet on the page.
portletId: the current portlet's id
node: the Alloy Node object of the current portlet
*/
function(portletId, node) {
}
);
Liferay.on(
'allPortletsReady',
/*
This function gets loaded when everything, including the portlets, is on
the page.
*/
function() {
}
);- AUI().ready(fn);
HTMLページの読み込み(AJaxで読み込まれるポートレットを抜く)が終了が実行されます。
- Liferay.Portlet.ready(fn);
ページ上の各ポートレットが読み込まれた後に実行されます。コールバックには2つのパラメータが返されます:portletIdとnode。portletIdは、読み込まれたポートレットのIdです。nodeはそのポートレットのAlloy Nodeオブジェクトです。
- Liferay.on('allPortletsReady', fn);
AJaxポートレットを含むすべてが読み込まれた後に実行されます。
19932 Visualizzazioni