in the routine that displays records, it refers to ordered_columns. i found the code that sorts the columns by the "pos" which i think i found in the .def file. can the pos in the def files be changed without affecting the data?
# -----------------------------------------------------------
# $obj->ordered_columns;
# ----------------------
# Returns the current table columns ordered
# in function of the "pos" type of a given
# column.
#
# The columns having no specified pos are
# appended in lexicographical order at the
# end of the result array.
#
my $self = shift;
my @cols = ();
my @append = ();
my $cols = $self->{schema}->{cols};
foreach my $col (sort {
$cols->{$a}->{pos} && $cols->{$b}->{pos} ? $cols->{$a}->{pos} <=> $cols->{$b}->{pos} :
$cols->{$a}->{pos} && !$cols->{$b}->{pos} ? -1 :
$cols->{$b}->{pos} && !$cols->{$a}->{pos} ? 1 :
($a cmp $b)
} keys %{$cols}) {
push @cols, $col;
}
return @cols;
}
Code:
sub ordered_columns { # -----------------------------------------------------------
# $obj->ordered_columns;
# ----------------------
# Returns the current table columns ordered
# in function of the "pos" type of a given
# column.
#
# The columns having no specified pos are
# appended in lexicographical order at the
# end of the result array.
#
my $self = shift;
my @cols = ();
my @append = ();
my $cols = $self->{schema}->{cols};
foreach my $col (sort {
$cols->{$a}->{pos} && $cols->{$b}->{pos} ? $cols->{$a}->{pos} <=> $cols->{$b}->{pos} :
$cols->{$a}->{pos} && !$cols->{$b}->{pos} ? -1 :
$cols->{$b}->{pos} && !$cols->{$a}->{pos} ? 1 :
($a cmp $b)
} keys %{$cols}) {
push @cols, $col;
}
return @cols;
}