You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@rstoenescu
First of all, thank you for such great quality in a product. World class!
I started using QTree in an Electron product and it's very similar to a file explorer structure. Directories on the left and child contents of the selected directory on the right. Above the QTree is a number of shortcuts (Home, Documents, Downloads, etc -- directories).
What I wanted is that if a user selects one of these shortcuts, or a folder on the right, that the QTree is able to open and select the proper node.
I am doing this using an "undocumented" function,setExpanded, in the QTree. This occurs after I collect the children information of that folder.
selectFolder: function (absolutePath) {
// get parts for the path
let parts = absolutePath.split('/')
let path = ''
let lastNodeKey
// iterate through the path parts.
// This code will get the node. If the node is not found,
// it forces lazy-get by programmatically expanding
// the parent node.
for (let index = 1; index < parts.length; ++index) {
path += '/' + parts[index]
if (index > 0) {
if ('folders' in this.$refs) {
const key = this.$refs.folders.getNodeByKey(path)
if (key) {
lastNodeKey = key
}
else {
if (lastNodeKey && lastNodeKey.children.length === 0) {
this.$refs.folders.setExpanded(lastNodeKey.nodeKey, true)
}
}
}
}
}
this.selected = path
},
This works pretty good, but I am concerned about it being undocumented. Is there a possibility this can be added in the documentation for QTree Methods?
Now, the enhancement part...
If a user has a large amount of folders (or expanded folders), when a folder is programmatically expanded and the the expanded key is not visible, that there would be an option to call <element>.scrollIntoView?
Thanks.
The text was updated successfully, but these errors were encountered:
@rstoenescu
First of all, thank you for such great quality in a product. World class!
I started using QTree in an Electron product and it's very similar to a file explorer structure. Directories on the left and child contents of the selected directory on the right. Above the QTree is a number of shortcuts (Home, Documents, Downloads, etc -- directories).
What I wanted is that if a user selects one of these shortcuts, or a folder on the right, that the QTree is able to open and select the proper node.
I am doing this using an "undocumented" function,
setExpanded
, in the QTree. This occurs after I collect the children information of that folder.This works pretty good, but I am concerned about it being undocumented. Is there a possibility this can be added in the documentation for
QTree Methods
?Now, the enhancement part...
If a user has a large amount of folders (or expanded folders), when a folder is programmatically expanded and the the expanded key is not visible, that there would be an option to call
<element>.scrollIntoView
?Thanks.
The text was updated successfully, but these errors were encountered: