Maypole::Plugin::QuickTable

Maypole::Plugin::QuickTable is a HTML::QuickTable convenience.
Download

Maypole::Plugin::QuickTable Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • David Baird
  • Publisher web site:
  • http://search.cpan.org/~davebaird/Tree-Authz-0.03/lib/Tree/Authz.pm

Maypole::Plugin::QuickTable Tags


Maypole::Plugin::QuickTable Description

Maypole::Plugin::QuickTable is a HTML::QuickTable convenience. Maypole::Plugin::QuickTable is a HTML::QuickTable convenience.SYNOPSIS use Maypole::Application qw( LinkTools QuickTable );METHODSsetup quick_tableReturns a HTML::QuickTable object for formatting data. print $request->quick_table( %args )->render( $data );The method gathers arguments from the quicktable_defaults method on the model class. This is a Class::Data::Inheritable method, so you can set global defaults on the main model class, and then override them in model subclasses. To preserve most settings and override others, say something like $sub_model->quicktable_defaults( { %{ $model->quicktable_defaults }, %hash_of_overrides } );Arguments passed in the method call override those stored on the model.Arguments are passed directly to HTML::QuickTable->new, so see HTML::QuickTable for a description.Additional arguments are: object => a Maypole/CDBI objectPass a Maypole/CDBI object in the object slot, and its data will be extracted and $qt->render called for you: print $request->quick_table( %args, object => $object );Related objects will be displayed as links to their view template.If no object is supplied, a HTML::QuickTable object is returned. If an object is supplied, it is passed to tabulate to extract its data, and the data passed to the render method of the HTML::QuickTable object.To render a subset of an object's columns, say: my @data = $request->tabulate( objects => $object, with_colnames => 1, fields => ); $request->quick_table( @data );tabulate( $object|$arrayref_of_objects, %args )Extract data from a Maypole/CDBI object (or multiple objects), ready to pass to quick_table->render. Data will start with a row of column names if $args{with_colnames} is true.A callback subref can be passed in $args{callback}. It will be called in turn with each object as its argument. The result(s) of the call will be added to the row of data for that object. See the list template in Maypole::FormBuilder, which uses this technique to add edit and delete buttons to each row.Similarly, a field_callback coderef will be called during rendering of each field, receiving the object and the current field as arguments. See the addmany template for an example.Arguments: callback coderef field_callback coderef with_colnames boolean fields defaults to ( $request->model_class->display_columns, $request->model_class->related ) objects defaults to $request->objectsorderby_link( $field, )Build a link for a column header. Controls whether the table should be sorted by that column. Toggles sort direction.The $model_class parameter is only necessary when building a table for a class different from the current model class for the request. Requirements: · Perl


Maypole::Plugin::QuickTable Related Software