|
|
Thread Tools | Search this Thread |
09-19-2013, 03:08 PM | #1 |
Calibre fan
Posts: 30
Karma: 10
Join Date: Jul 2011
Location: Europe
Device: iRex 800SG, iPhone 3GS (shelved: iRex iLiad, KindleDX, Adam tablet)
|
A way to have column w Fixed set o values but not alphabeticaly sorted ?
I am looking for something like Enum type in most programming languages.
Right now there is 'fixed set of values' column type, but it is sorted alphabeticaly based on the text values. What am I aiming for: You may have a set of values like: Great, Good, Bad, Worst Though with 'fixed set of values' column type, that is afaik always sorted alphabeticaly, that will be sorted: Bad, Good, Great, Worst Obviously not right. Any way to make this work in Calibre ? Thanks |
09-19-2013, 04:28 PM | #2 |
null operator (he/him)
Posts: 20,570
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Prefix with '10', '20'... then you'll have gaps for inserting intermediate values
|
09-19-2013, 05:33 PM | #3 |
Calibre fan
Posts: 30
Karma: 10
Join Date: Jul 2011
Location: Europe
Device: iRex 800SG, iPhone 3GS (shelved: iRex iLiad, KindleDX, Adam tablet)
|
BetterRed - sorry not sure what you mean. Can you elaborate a bit ?
|
09-19-2013, 05:47 PM | #4 | |
null operator (he/him)
Posts: 20,570
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
And you can add '15 Very Good BR Last edited by BetterRed; 09-19-2013 at 05:52 PM. |
|
09-19-2013, 05:51 PM | #5 |
Calibre fan
Posts: 30
Karma: 10
Join Date: Jul 2011
Location: Europe
Device: iRex 800SG, iPhone 3GS (shelved: iRex iLiad, KindleDX, Adam tablet)
|
Ah sure. Thanks for a tip !
Im affraid thats not very elegant solution tough. The numbers will show in the column and everywhere else as well (right ?) Is there any better way to do it ? A 'proper' way to do it ? Thinking of it maybe the numbers can be removed using column display style(s) ? Or maybe a numerical column and then swap the numbers for titles with display style(s) ? Not sure how the styles work though. Just remember seeing a part in Cal manual about it. :\ Last edited by Riva3000; 09-19-2013 at 05:53 PM. |
09-19-2013, 06:00 PM | #6 | |
null operator (he/him)
Posts: 20,570
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
In the spreadsheet you could set up icons for each value using the Look and Feel->Column Icons Feature. If you want a perfect solution you may have to raise an Enhancement Request here BR |
|
09-19-2013, 06:05 PM | #7 |
Calibre fan
Posts: 30
Karma: 10
Join Date: Jul 2011
Location: Europe
Device: iRex 800SG, iPhone 3GS (shelved: iRex iLiad, KindleDX, Adam tablet)
|
I know I know BetterRed. Thanks for the tip!
..or I might copy and edit Calibre code for the Fixed set column. Will Kovid kill me ?! |
09-20-2013, 03:17 AM | #8 | |
Grand Sorcerer
Posts: 11,741
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
You must be talking about sorting the column, not sorting the values in the edit combobox, because the order of the values in the box is the same as in the column declaration. Thus, for you to be happy you would need to change calibre's column sort, detecting (somehow) that this particular text column is to be sorted by something other than text. This is possible to do, but not trivial. You would need to generate a sort value ("key" in calibre) that is related to the order in the column declaration. And you would need to do this in a way that preserves performance. Another option that is more elegant but quite different: use an integer column and column icons. The integer would map to your categories. The icon would give you a human-understandable visual representation. You could go so far as to add icons for the letters of the alphabet and use the multiple-icon feature in today's calibre release (1.4) to spell out what you want it to say. Of course, this works only on calibre's spreadsheet. It wouldn't show the icons in book details or elsewhere. EDIT: The letters idea won't work with basic rules because you cannot specify the order of the icons. It would work if you used an advanced template, because there you are in charge of their order. A third option: use an integer column, then add a column built from other columns to display the correct text. This has the advantage that the text will be visible in book details, etc. It has the disadvantage of requiring two columns. Last edited by chaley; 09-20-2013 at 03:39 AM. |
|
09-20-2013, 12:52 PM | #9 | ||||||
Calibre fan
Posts: 30
Karma: 10
Join Date: Jul 2011
Location: Europe
Device: iRex 800SG, iPhone 3GS (shelved: iRex iLiad, KindleDX, Adam tablet)
|
Never is, but its my favorite hobby to seek perfection
Quote:
Quote:
Quote:
Quote:
Quote:
I thought about that as well, but at the end seemd too hacky. Plus the problems you came at. Quote:
1. you cannot directly edit the composite column. You always have to go to the 'source' column to change values. I'm already using that system. Quite annoying. 2. When changing values (in source column) you have to choose from nondescript numbers, instead of values you want. Maybe you can do what BetterRed wrote - prefixing the strings with int. Then make a composite column that will lose the prefix. Not sure if it'll retain the sorting thought. Gt test. At the end though, it might be easier to just add to Calibre's code Anyway thanks for all the ideas !! I'll keep trying. Last edited by Riva3000; 09-20-2013 at 12:56 PM. |
||||||
09-21-2013, 06:03 PM | #10 |
Guru
Posts: 787
Karma: 1575310
Join Date: Jul 2009
Device: Moon+ Pro
|
Have you considered a 'reverse' procedure? Set your descriptive column according to your list but have a numeric column set via formula. Then sort by the numeric column. That would put your descriptive column into the desired order but still let you change that descriptive field.
|
Tags |
calibre, column settings, columns, enum |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Default Value for Custom Column (fixed set of permitted values) | Andy P | Calibre | 1 | 06-21-2013 03:25 AM |
Custom Column with list of permitted values | Eugenie | Library Management | 1 | 01-10-2012 03:57 AM |
Boolean custom column values | sengian | Library Management | 4 | 01-05-2012 05:39 PM |
Multiple comma separated values in custom column? | silentguy | Library Management | 8 | 04-19-2011 05:10 AM |
displaying multiple values in the same column beneath each other | Firedancer885 | Calibre | 2 | 11-27-2010 03:13 PM |