[Catalyst] Dumb question of a beginner

Alex Povolotsky tarkhil at over.ru
Mon Feb 11 10:21:15 GMT 2008


Chisel Wright wrote:
> On Mon, Feb 11, 2008 at 12:55:55PM +0300, Alex Povolotsky wrote:
>   
>> Hello!
>>
>> I haven't find the answer in FAQ and cookbook, so I'm asking here.
>>
>> How do I add server-side sorting for list operation? I want to select * 
>> from table sort by field instead of default select * from table
>>     
>
> I think you are looking for 'order_by' in perldoc DBIx::Class::ResultSet
>
>   
Looking at Catalyst::Enzyme::CRUD::Controller


sub list : Local {
    my ( $self, $c ) = @_;
    my $model = $self->model_with_pager($c, 
$self->crud_config->{rows_per_page}, $c->req->param("page"))
;
    $c->stash->{items} = [ $model->retrieve_all() ];
    $c->stash->{template} = 'list.tt';
}

what should I change?

Alex.




More information about the Catalyst mailing list