私はLiferay-AUIデータテーブルを用意しています。このテーブルでは、単一の行選択を許可し、各行が選択されるとスクリプトを呼び出します。スクリプトは、選択されたばかりの行を特定し、何らかのアクションをとる必要があります。Liferay AUIデータテーブルを使用した行選択
現在の実装例です。上記の要件を追加する方法についての提案は高く評価されます。
<div id="productsTable"></div>
<aui:script use="datatable,datatable-sort,datatable-scroll,datatable-highlight,datatable-selection,liferay-portlet-url">
var roleColumns = [ {
label : 'Providing Role Name',
key : 'providerRoleName',
sortable : true,
allowHTML : true,
formatter : function(o) {
var renderURL = Liferay.PortletURL
.createURL('<%= productDetailUrl %>');
renderURL.setParameter('productId', o.data.productId);
return '<a href="' + renderURL.toString() + '">'
+ o.data.providerRoleName + '</a>';
}
}, {
label : 'Cardinality',
key : 'cardinality',
sortable : true
} ];
new A.DataTable({
columns : roleColumns,
rowSelect: 'mousedown',
data : <%=renderRequest.getAttribute("roles")%>,
scrollable : "xy",
height : "400px",
width : '100%',
sort : 'true',
highlightRows : true
}).plug(A.Plugin.DataTableSelection, {
selectRow : true
}).render('#productsTable');
</aui:script>
感謝。残念ながら、上記は私にとっては役に立たなかった。私はいくつかの小さな変更を見つけましたが、代替ソリューションを選択しました(次の記事を参照)。 –