The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Rose::DBx::Garden::Catalyst::YUI::DataTable - YUI DataTable struct

SYNOPSIS

 my $datatable = $yui->datatable( 
            results     => $results,    # CX::CRUD::Results or CX::CRUD::Object
            controller  => $controller, 
            form        => $form,
            method_name => $rel_info->{method},
            field_names => $form->field_names,
  );
  
 $datatable->data;  # returns serialized results
 $datatable->count; # returns number of data
 

METHODS

init( opts )

Overrides base method to build the DataTable object. You usually call this via RDGC::YUI->datatable( opts ).

Attributes

A DataTable object has the following attributes:

results

The results object passed in.

form

The form object passed in.

controller

The controller object passed in.

pk

The primary key of the table.

columns

An arrayref of column hashrefs. YUI DataTable needs these.

url

The url for fetching JSON results.

A hashref of foreign key information.

col_filter

An arrayref of column names. # TODO used for??

col_keys

An arrayref of column names.

data

An arrayref of hashrefs. These are serialized from results.

count

The number of items in data.

counter

User-level accessor. You can get/set this to whatever you want.

column( field_name )

Return the column hashref meta for field_name. The hashref has 3 keys: key, label, and sortable.

data

Get serialized results(). Returns an arrayref.

set_data( array_ref )

If for some reason you must override the automatically generated data from results(), you may use this method to set the array ref explicitly.

AUTHOR

Peter Karman, <karman at cpan.org>

BUGS

Please report any bugs or feature requests to bug-rose-dbx-garden-catalyst at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Rose-DBx-Garden-Catalyst. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

    perldoc Rose::DBx::Garden::Catalyst

You can also look for information at:

ACKNOWLEDGEMENTS

The Minnesota Supercomputing Institute http://www.msi.umn.edu/ sponsored the development of this software.

COPYRIGHT & LICENSE

Copyright 2008 by the Regents of the University of Minnesota.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.