In version 11.0 we have changed how we determine which Calculation Columns are visible by default:
- The default maximum number of visible calculation columns is 10 columns.
- These 10 columns are determined by a voting system (details below).
- The votes do not affect custom article views.
- Without any votes, there will be 7 default columns.
Default Column Visibility
Every calculation column has been made not visible by default except these seven:
- Complete
- Description
- Quantity
- List
- Manual Sort
- Options
- Part Number
You can make them visible by default through voting as described in the section(s) below.
The default visibility changes should not affect custom article views except for Tag Columns.
Tag Columns require extensions to override a method (from cm/core/calculationView.cm) in their custom article view for them to be visible there:
/** * Set tag calc columns initial visibility. * (Override to set for custom article views). */ extend public void setTagColumnsInitialVisibility(PartColumn[] tagColumns) { for (c in tagColumns) if (c as TagCalcColumn) c.initiallyVisible = false; }
Voting System Summary
The voting system chooses which 10 default columns to display as follows:
- Choose the 10 columns with the highest number of votes. This includes any 0 vote-columns that are initially visible.
- For ties, we will the "order" value in the column's Class to decide.
- After choosing the 10 columns, they will be sorted according to just "order" regardless of votes.
Voting System Example
- I start a clean CET with every extension disabled. These are the columns I see:
- After I start FIKA (the extension upvotes 5 columns), these are the new columns I see:
These 5 columns are from the defaults that are initially visible, with 0 votes. They were chosen because they had the lowest "order" (from their ownPartColumn
Class) out of the 7.
These 5 columns were upvoted by FIKA with 1 vote each. - These columns are sorted based on their "order" value in their respective Classes.
Upvoting Columns in Code
Voting for columns is done like this.
upvotePartColumnVisibility(absUpchargePartColumn.key); upvotePartColumnVisibility(absSourcePartColumn.key);
For tag columns, there are no public PartColumn
classes so you have to unfortunately specify the key like this:
upvotePartColumnVisibility("#cm.core;TAG1");
You can find core/abstract part columns in the following places:
- cm/core/init/corePartColumns.cm
- cm/abstract/dataSymbol/init.cm
- cm/abstract/part/partColumns.cm
These votes should be placed in the extension's start()
. They will be cast once the extension is turned on (for lazy extensions, this means when it is selected in the toolbox).
FAQ
- What is the rationale behind these changes? Why can "default" columns be outvoted?
A: The main motivation of this change was just to cut down on the number of columns shown by default in the main article view, to reduce clutter. Hence, it is possible for the default columns to be outvoted. - Do the votes affect custom article views?
A: No, the votes only affect the main article view. - Tag Columns are missing from my custom article view!
A: You have to overridesetTagColumnsInitialVisibility
(from cm/core/calculationView.cm) to set them to visible by default. - Can the default "7" columns be outvoted so they are not the default?
A: Yes, they can be. They have 0 votes. The voting system takes any visible by default column with 0 votes as participants too. - Do Abstracts upvote any Columns?
A: No, abstracts do NOT upvote any columns.
Comments
0 comments
Please sign in to leave a comment.