Closed mm-ryo closed 4 years ago
We couldn't recreate the presence of content when item is not hovered nor selected. Can you specify how to recreate this?
We are working to improve this feature so that:
In this way you can set in your code when and for which items the content is allowed.
These improvements will be included in coming update 19.4.
This feature is now updated in our internal build.
There is a new property named contentVisibility that can accept one of the following values from IntegralUIContentVisibility enumeration:
In combination with item.contentVisibility field value (accepts values from same enumeration), you can determine when content will appear.
For example, the TreeView has contentVisibility set to Both (by default), and the 'Downloads' item has contentVisibility set to Hover. So when this items is selected, the select content will not appear, will appear only when it is hovered. You can change this on demand:
this.items = [
{
id: 1,
text: "Favorites",
icon: "computer-icons favorites",
items: [
{ id: 11, pid: 1, text: "Desktop", icon: "computer-icons empty-doc" },
{ id: 12, pid: 1, text: "Downloads", icon: "computer-icons downloads", contentVisibility: IntegralUIContentVisiblity.Hover }
]
},
. . .
result is:
By default contentVisibility property is set to Both and if items don't have their contentVisibility field set or set as undefined, it is presumed that the value is Both.
This feature is now updated in our internal build.
There is a new property named contentVisibility that can accept one of the following values from IntegralUIContentVisibility enumeration:
- None
- Hover
- Select
- Both
In combination with item.contentVisibility field value (accepts values from same enumeration), you can determine when content will appear.
For example, the TreeView has contentVisibility set to Both (by default), and the 'Downloads' item has contentVisibility set to Hover. So when this items is selected, the select content will not appear, will appear only when it is hovered. You can change this on demand:
this.items = [ { id: 1, text: "Favorites", icon: "computer-icons favorites", items: [ { id: 11, pid: 1, text: "Desktop", icon: "computer-icons empty-doc" }, { id: 12, pid: 1, text: "Downloads", icon: "computer-icons downloads", contentVisibility: IntegralUIContentVisiblity.Hover } ] }, . . .
result is:
By default contentVisibility property is set to Both and if items don't have their contentVisibility field set or set as undefined, it is presumed that the value is Both.
this is a very nice feature. thanks a lot. if multiple items selected, could we stop to display the selected toolbar? or add another option for this case. in our project, we hide the selected toolbar if more than 1 item is selected.
Yes, just change the contentVisibility property to Hover when there are more than one selected items, and back again to Both when there is only one or none selected items. You can do this by handling the selectionChanged event:
HTML
<iui-treeview [items]="items" [appRef]="applicationRef" [selectionMode]="selMode" [virtualMode]="true" [itemDisplay]="0" [contentVisibility]="contentVisibility"
(selectionChanged)="onSelectionChanged($event)" #treeview>
Angular
import { IntegralUIContentVisiblity } from ./integralui/components/integralui.core';
. . .
public contentVisibility: IntegralUIContentVisiblity = IntegralUIContentVisiblity.Both;
onSelectionChanged(e: any){
let selList = this.treeview.getList('selected');
this.contentVisibility = selList.length > 1 ? IntegralUIContentVisiblity.Hover : IntegralUIContentVisiblity.Both;
}
or just set it directly using treeview reference:
this.treeview.contentVisibility = selList.length > 1 ? IntegralUIContentVisiblity.Hover : IntegralUIContentVisiblity.Both;
Hi, This feature did not meet my requirements. actually what I want is if there is an item selected the toolbar will be displayed on left, if more then one selected the toolbar will be hidden, but if I mouse over to the item the toolbar should be displayed.
thanks
The 'Favorites' item is not active/selected and hovered, but the toolbar is still there.
I also found some other cases :
Currently, there is no API exposed to do interaction with it.
Steps: Press Ctrl + Mouse Left button click to select items or un-select items