Attributes column - option to hide some attributes?

Can you add an option to hide some attributes from the Attributes column?

Non-content indexed attribute - this is the one that bothers me the most, as i moved to v12 and dont used Indexing service at all
Archived - never used it on my home PC

I was somehow used to A, but with the addition of I, this column gets wider now. So now i have 2 things that i dont want to see instead of one + a couple of wasted pixels. :confused:

I know it is a really small thing, but maybe you can do this someday?

How about using a custom column?

Here's a start. Un-comment and rearrange the attributes to your needs.

// https://resource.dopus.com/t/attributes-column-option-to-hide-some-attributes/34410

function OnInit(initData) {
    initData.name = 'MinimalAttributes';
    initData.version = '1.0';
    initData.default_enable = true;
    initData.min_version = '12.0';

    var col = initData.AddColumn();
    col.method = 'OnMinimalAttributes';
    col.name = 'MinimalAttributes';
    col.label = 'MinimalAttributes';
    col.header = 'A';
    col.justify = 'right';
    col.defwidth = 2;
    col.autorefresh = 1;
    col.autogroup = true;
}

function OnMinimalAttributes(scriptColData) {
    var itemAttrib = scriptColData.item.fileattr;
    var result ='';

    // if (itemAttrib.archive) result += 'a';
    // if (itemAttrib.compressed) result += 'c';
    // if (itemAttrib.encrypted) result += 'e';
    // if (itemAttrib.hidden) result += 'h';
    // if (itemAttrib.nonindexed) result += 'i';
    // if (itemAttrib.offline) result += 'o';
    // if (itemAttrib.pinned) result += 'p';
    if (itemAttrib.readonly) result += 'r';
    // if (itemAttrib.system) result += 's';

    scriptColData.value = result;
}

ColumnMinimalAttributes.js.txt (1.1 KB)

2 Likes

Hello!
I have never used custom JS scripts in DOpus... so can i ask you some silly questions?

  • How fast is DOpus JS engine vs internal functions?
  • Can this JS slow down file operations/listings in folders with a lot of files inside (50000+)?

How fast is DOpus JS engine vs internal functions?

That's a difficult question. Scripts in JScript can be much smarter and therefore faster than normal Opus command buttons. How much faster would a built-in column be calculated compared to the scripted version? Maybe a bit, but that's just guessing.

Can this JS slow down file operations/listings in folders with a lot of files inside (50000+)?

Custom columns can slow things down, but in this case I wouldn't be worried.