Closed (fixed)
Project:
Money field
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
7 Nov 2007 at 09:57 UTC
Updated:
5 Mar 2008 at 21:24 UTC
By adding 'sortable' to the database column defs, you can make it sortable:
case 'database columns':
$columns['amount'] = array(
'type' => 'int',
'length' => 13,
'not null' => TRUE,
'default' => 0,
'unsigned' => FALSE,
'sortable' => TRUE,
);
$columns['currency'] = array('type' => 'varchar', 'length' => 3, 'sortable' => TRUE);
return $columns;
Comments
Comment #1
wim leersBut sorting amounts with different currencies doesn't make much sense...
Comment #2
M. P. commentedI use your module - by the way, thank you very much - with only 1 currency, because of its powerfull formatting options and separator treatment.
So, sometimes sorting could make sense.
Comment #3
wim leersThat's true. But I don't like half-baked solutions... hence I was postponing this. Since you seem to be able to write code, could you please verify the code that hamidrj posted?
Comment #4
M. P. commentedhamidrj's code works well, like expected.
NOTE for "updaters": If you have already existing money fields, they won't get "sortable", of course.
You have to create new ones or fidling with the database - which I wouldn't recommend.
Comment #5
wim leersCommitted. Thanks!
Comment #6
wim leersComment #7
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.