掲示板

Alloy UI 1.5 on Liferay 6.0x due to TreeNodeRadio

thumbnail
11年前 に Bernardo Puglia Lima によって更新されました。

Alloy UI 1.5 on Liferay 6.0x due to TreeNodeRadio

Junior Member 投稿: 41 参加年月日: 12/01/25 最新の投稿
Hello everyone!

I'm trying to use a feature that I have noticed to be found only on Alloy UI 1.5 (http://deploy.alloyui.com/api/classes/TreeNodeRadio.html) but I need it to work on a Liferay 6.0 SP2 environment.

Is there a way to upgrade the Alloy UI 1.0.1 -> 1.5 to use it on versions prior to Liferay 6.1?

Or if anyone knows a way to allow just a single selection on a TreeNodeCheck on 1.0.1 would solve my problem as well!

Thanks in advance!
thumbnail
11年前 に Eduardo Lundgren によって更新されました。

RE: Alloy UI 1.5 on Liferay 6.0x due to TreeNodeRadio

Junior Member 投稿: 25 参加年月日: 08/06/18 最新の投稿
Hello Bernardo,

Alloy 1.0.x doesn't have TreeNodeRadio out of the box.

One recommendation is that you create that class, copying A.TreeNodeRadio from the 1.5.x source, and place it in any javascript file from your portlet.

I have attached a zip file with an example.

添付ファイル:

thumbnail
11年前 に Bernardo Puglia Lima によって更新されました。

RE: Alloy UI 1.5 on Liferay 6.0x due to TreeNodeRadio

Junior Member 投稿: 41 参加年月日: 12/01/25 最新の投稿
Worked perfectly!

For those who need it, copy the tree-node-radio.js to the js folder and the radios.png to the css folder. Add the following line to liferay-portlet.xml:

<header-portlet-javascript>/js/tree-node-radio.js</header-portlet-javascript>


And the following classes to the main.css:


.aui-tree-node-radio .aui-tree-node-checkbox-container {
	background: transparent url(radios.png) no-repeat 0 50%;
}

.aui-tree-node-radio-checked .aui-tree-node-checkbox-container {
	background-position: -16px 50%;
}


Just one little issue: when I select a node that has children, the selected (parent) and the last child are selected, but if I select the last child of some other node, the parent isn't selected. Is this a normal behaviour?

Once again, thanks!
thumbnail
11年前 に Bernardo Puglia Lima によって更新されました。

RE: Alloy UI 1.5 on Liferay 6.0x due to TreeNodeRadio

Junior Member 投稿: 41 参加年月日: 12/01/25 最新の投稿
Well, due to this bug I had to stick with a jQuery tree solution on this particular case.

Regards!