Column listing age of file in days - need script help

Format in which sense? I'm not sure I understand the questiom, sorry. Can you give more details, and maybe some examples of what happens vs what you want to happen?

Leo,

The configuration for each column do not work as expected or intended when the config is different for each column. If both are set to "auto," the columns appear as expected:



If both are set to "Units," the columns appear as expected:


However, when both are set differently, they default to the Age (C) config:




I'm guessing it's because the "Created" config comes first in the script. I would like for the columns to be independently configured, if possible.

So what am I missing?

Thanks for taking a look!

Is the last full snippet still the one you are using?

I spotted a weird thing in OnAddColumns():

.. var method = ["Auto","Units"]; cmd.method = method[Script.config["Modified"]]; ..
I get the idea behind, but if this is still the way you do it, it's actually surprising this works at all.
You should remove the dquotes around "Auto" and "Units", since you want the functions to be passed and not strings containing their names.

After changing the script config it might also be necessary to use the OnAfterScriptConfigChange() event or what it's exact name is.
In that call Script.InitColumns() to rebuild them with the updated function reference in cmd.method = .. I might be wrong and if that does not cure your issues, consider uploading a current version to play with. Thx! o)

Taking out the dquotes totally kills the script. I have included it for your consideration.
Column.Generic_Age_Working.js.txt (7.83 KB)

Yes, sorry, forget what I said about the dquotes. I mixed things up with the j(ava)script I do elsewhere currently. The column.method property expects a string with a function name of course, not a reference to a function (which would be just the name of the function without the dquotes).

There error is somehwere else and it is not in the way you assign functions for the columns. It's in the column functions, as they always set both columns. That's why you cannot have one column showing units, while the other is set to auto.

I removed some of the duplicate code which served both columns at the same time.
The column function now only act on one column at a time, so using different methods for each makes sense eventually.
Column.Generic_Age_Working.js.txt (11.8 KB)
While I tinkered with that script I was also able to reproduce a script column bug I saw with another script. So if the uploaded fix works for you, I guess we have a win win situation here. o)

Thanks for the help tbone.

Unfortunately, your adjustment didn't solve the issue, although it changed it a bit. Regardless of config (same or different), only the first column opened will display info based on its specific setting. The other column, when opened, will appear blank. With both columns displayed, Refresh All will display Age (C) in its specific config and Age (M) blank.



It just doesn't seem to want to work through the functions independently. Not sure what's missing...

Watch this, it seems you're also affected by the bug I was talking about: resource.dopus.com/viewtopic.ph ... 96#p154696

tracking!