CGI-OptimalQuery
view release on metacpan or search on metacpan
html_formatter => CODEREF
sub { my ($val, $rec, $o, $colAlias) = @_; return $val; }
# Built in formatters to display all field/values specified in
'select' as html.
\&CGI::OptimalQuery::Base::recview_html_formatter
is_hidden => 1
hides the select field and data from being viewed by the user.
Data for this select is still available in callbacks and can
be included in the hiddenFilter.
always_select => 1
tells OptimalQuery to always select the column regardless if
it isn't explicitly being used in the show. This does not
automatically make it shown to the user, but it will be
available to the developer in callbacks.
select_sql => (STRING | ARRAYREF)
filter_sql => (STRING | ARRAYREF)
sort_sql => (STRING | ARRAYREF)
SQL to use instead of the default SQL for the select for the
context described.
date_format => (STRING)
if column is a date and date format is specified, OptimalQuery
will write SQL to use the date format appropriately.
This is an advanced feature that can help perl guru's change the
factory blueprints for optimal query modules instantiated by
CGI::OptimalQuery.
named_filters => { NORMAL_NAMED_FILTER, CUSTOM_NAMED_FILTER, .. }
allow developers to create complex predefined sql for insertion in the
where clause by the 'filter' and 'hiddenFilter' parameters. There are
two types of named_filters: "normal" and "custom". Normal named
filters are defined with static SQL. Custom named filters are dynamic
and most often take arguments which influence the SQL and bind params
generated via callbacks.
NORMAL_NAMED_FILTER
filterNameAlias => [ DEP, SQL, NAME ]
DEP is a string or an ARRAY of strings describing the dependancies
used by the named filter. SQL is a string or an arrayref with
SQL/bind values that is used in the where clause when the named
filter is enabled. The NAME is used to describe the named filter
to the user running the report.
}
noEscapeCol => ['NAME']
if certain columns should not be HTML escaped, let OptimalQuery know
by adding them to this array.
OQdataLCol => sub { }
OQdataRCol => sub { }
Specify custom code to print the first or last column element. This
is most often used to generate an view/edit button. If these
callbacks are used, the editLink, and buildEditLink are ignored.
OQdataLCol => sub {
my ($rec) = @_;
return "<button onclick=\"OQopwin('/ViewRecord?id=$$rec{U_ID};on_update=OQrefresh';\">".
"view</button>";
}
OQdocBottom => "bottom of the document (outside form)"
OQdocTop => "top of the doc (outside form)"
OQformBottom => "bottom of form"
lib/CGI/OptimalQuery.pm view on Meta::CPAN
sub {
my ($val) = @_;
return $val;
}
# format a value before it is executed in the database
=item B<< is_hidden => 1 >>
hides the select field and data from being viewed by the user. Data for this select is still available in callbacks and can be included in the hiddenFilter.
=item B<< always_select => 1 >>
tells OptimalQuery to always select the column regardless if it isn't explicitly being used in the show. This does not automatically make it shown to the user, but it will be available to the developer in callbacks.
=item B<< select_sql => (STRING | ARRAYREF) >>
=item B<< filter_sql => (STRING | ARRAYREF) >>
=item B<< sort_sql => (STRING | ARRAYREF) >>
SQL to use instead of the default SQL for the select for the context described.
=item B<< date_format => (STRING) >>
lib/CGI/OptimalQuery.pm view on Meta::CPAN
For example:
<a href=/Search?filter=".escape_uri("[NAME] like 'foo'")
=item B<< module => { OverloadModuleLabel => PerlModuleName, .. } >>
This is an advanced feature that can help perl guru's change the factory blueprints for optimal query modules instantiated by CGI::OptimalQuery.
=item B<< named_filters => { NORMAL_NAMED_FILTER, CUSTOM_NAMED_FILTER, .. } >>
allow developers to create complex predefined sql for insertion in the where clause by the 'filter' and 'hiddenFilter' parameters. There are two types of named_filters: "normal" and "custom". Normal named filters are defined with static SQL. Custom n...
=over
=item B<< NORMAL_NAMED_FILTER >>
filterNameAlias => [ DEP, SQL, NAME ]
DEP is a string or an ARRAY of strings describing the dependancies used by the named filter. SQL is a string or an arrayref with SQL/bind values that is used in the where clause when the named filter is enabled. The NAME is used to describe the named...
=item B<< CUSTOM_NAMED_FILTER >>
lib/CGI/OptimalQuery.pm view on Meta::CPAN
}
=item B<< noEscapeCol => ['NAME'] >>
if certain columns should not be HTML escaped, let OptimalQuery know by adding them to this array.
=item B<< OQdataLCol => sub { } >>
=item B<< OQdataRCol => sub { } >>
Specify custom code to print the first or last column element. This is most often used to generate an view/edit button. If these callbacks are used, the editLink, and buildEditLink are ignored.
OQdataLCol => sub {
my ($rec) = @_;
return "<button onclick=\"OQopwin('/ViewRecord?id=$$rec{U_ID};on_update=OQrefresh';\">".
"view</button>";
}
=item B<< OQdocBottom => "bottom of the document (outside form)" >>
=item B<< OQdocTop => "top of the doc (outside form)" >>
( run in 0.619 second using v1.01-cache-2.11-cpan-9b1e4054eb1 )