Elliott Rezny via RT wrote on 07/07/2010 05:50 PM:
Show quoted text> Wed Jul 07 18:50:43 2010: Request 59177 was acted upon.
> Transaction: Ticket created by rezny@cs.wisc.edu
> Queue: Rose-DBx-Garden-Catalyst
> Subject: Livegrid columns in seemingly random order
> Broken in: (no value)
> Severity: (no value)
> Owner: Nobody
> Requestors: rezny@cs.wisc.edu
> Status: new
> Ticket <URL:
https://rt.cpan.org/Ticket/Display.html?id=59177 >
>
>
> I don't have enough test-cases to tell what the method of order is, but
> I'm having trouble getting the livegrid to keep the columns in a
> reasonable order rather than expect the user to reorder the columns or
> put up with a sub-par view. This may be an underlying issue in
> CatalystX::CRUD::YUI::LiveGrid, but I'm hoping I am just missing the
> official way of ordering the columns. I have the rank and tabindex set
> cor each column in the form.pm, and while the view and edit pages
> respect them, the livegrid does not.
>
You can declare the livegrid column order in the RHTMLO::Form subclass,
using the 'field_methods' and 'default_sort_by' params. There's not very
good documentation on this; patches appreciated.
Here's what my class looks like:
package MyApp::RDBO::Foo::Form;
use strict;
sub init_metadata {
my $self = shift;
return $self->metadata_class->new(
form => $self,
controller_prefix => 'RDGC',
labels => {
foo => 'A Label by any other Name',
bar => 'The Path to Enlightenment',
color => 'The Color', # not shown in livegrid
},
default_sort_by => 'foo',
field_methods => [qw( foo bar )], # NOTE color not here
);
}
--
Peter Karman .
http://peknet.com/ . peter@peknet.com