Possible to expand/collapse all subfolders in Lister view?

Is there a way to expand/collapse all subfolders of the specified folder in the Lister views? For example, it would nice to be able to Alt+click (or whatever) a folder's expansion icon to open/close all of it's subfolders.

I tried searching this forum, as well as DOpus' preferences, but it's possible that I've overlooked something. I'm also happy to file a feature request if there's no such option currently available. Thanks.

See here:

He made a script that has more expand/collapse abilities. I'm not sure if his newest version is on that particular thread.
I think adding =All to the main code (when making a command on a button) it is the all you're looking for. You have to select the folder first, or else all in the parent are affected.

1 Like

Here is a three button button that toggles between expand and collapse for either all folders or all selected folders. The code for the button follows the button code.

Expand-Collapse Folders Options.dcf (1015 Bytes)

<?xml version="1.0"?>
<button 3dborders="no" backcol="none" display="label" icon_size="large" label_pos="right" textcol="none" type="three_button">
	<label>Expand|Collapse Folders Options</label>
	<icon1>#folderexpander</icon1>
	<button 3dborders="no" backcol="none" display="label" icon_size="large" label_pos="right" textcol="none">
		<label>Expand|Colapse All Folders</label>
		<tip>Expand|Colapse All Folders</tip>
		<icon1>#folderexpander</icon1>
		<function type="normal">
			<instruction>Go * EXPANDBRANCH=wild,toggleall,top</instruction>
		</function>
	</button>
	<button 3dborders="no" backcol="none" display="label" icon_size="large" label_pos="right" textcol="none">
		<label>Expand|Collapse Selected Folders</label>
		<icon1>#folderexpanded</icon1>
		<function type="normal">
			<instruction>@disablenosel:dirs</instruction>
			<instruction>@disableif:Set EXPANDABLEFOLDERS=off </instruction>
			<instruction>GO EXPANDBRANCH toggle</instruction>
		</function>
	</button>
</button>

1 Like

Thanks very much, @ASUNDER! This gets me pretty close to what I was trying to accomplish.

I've assigned a keyboard shortcut (Ctrl+>) to "ExpandFolders TOGGLE", which does the following:

  • With a selection: expands/collapses all selected folders and their subfolders §
  • Without a selection: expands/collapses all folders and their subfolders ‡

§ This is what I wanted.

‡ This is just byproduct: as others have mentioned, this can already be achieved (and faster) with DOpus' native Flat View (Grouped).

1 Like

Thanks for your response, @jinsight. Unfortunately, that only expands the top level, not nested subfolders.

I was trying to keep it simple by only using basic commands rather than scripts. I do use errante's script. Depending on the number of folders and subfolders, the initial expansion can take a noticeable amount of time when using the script. Using basic commands provides a "solution" to this.

2 Likes

Maybe the ExpandFolders script addin can help?

1 Like

Have you tried Flatview/Grouped? It's typically very fast.

1 Like

@jinsight Of course! And I appreciate your response. Thank you.

Yes, @Felix.Froemel, that's the solution I've adopted (as recommended by @ASUNDER).

I use Flat View (Grouped) all the time, but in this particular case, I was looking for a way to expand all the subfolders of the selected folder only (i.e., not all folders/subfolders). Thanks, @lxp.