I am looking for a button or a command that I can use to resize all of the columns so that they fit the full width of the lister.
I have tried Set AUTOSIZECOLUMNS
, it does not fully do what I need though.
In the following example, I just used the command, you can see Name is truncated and there is still decent amount of empty space on the right.
Perhaps this is the wrong command?
Any help would be greatly appreciated!
Can I get help with this?
Try this button script:
On-Off Auto-Size Columns Toggle.dcf (1.5 KB)
Code:
<?xml version="1.0"?>
<button 3dborders="no" backcol="none" display="label" hotkey="ctrl+space" hotkey_label="yes" icon_size="large" label_pos="right" textcol="none">
<label>On|Off Auto-Size Columns Toggle</label>
<tip>Set Columns to Auto-sized Otherwise Reset the Folder Format to That of the Folder</tip>
<icon1>#Column Header</icon1>
<function type="script">
<instruction>@script JScript</instruction>
<instruction>function OnClick(clickData){</instruction>
<instruction> var colParams = "";</instruction>
<instruction> for(var e = new Enumerator(clickData.func.sourcetab.format.columns); !e.atEnd(); e.moveNext()){</instruction>
<instruction> var col = e.item();</instruction>
<instruction> if (!col.Autosize || col.Max != 0){</instruction>
<instruction> if (colParams) colParams += ",";</instruction>
<instruction> colParams += col.Name;</instruction>
<instruction> colParams += "(!,a,0)"; // Keep position. Auto-size. No maximum.</instruction>
<instruction> }</instruction>
<instruction> }</instruction>
<instruction> var cmd = "Set FORMAT=!folder";</instruction>
<instruction> if (colParams) cmd = 'Set COLUMNSADD="'+colParams+'"';</instruction>
<instruction> clickData.func.command.deselect = false;</instruction>
<instruction> clickData.func.command.RunCommand(cmd);</instruction>
<instruction>}</instruction>
</function>
</button>
1 Like
Leo
October 7, 2024, 7:26pm
4
Do you have a maximum size set on the Name column? That would explain it if so.
hmmm, not sure. I will get back to this issue and check to see if it was down to this. I will report back.