some bugfixes. less reliance on pre-prepared form control
This commit is contained in:
parent
63de5b4ee7
commit
503c216741
1 changed files with 6 additions and 3 deletions
|
|
@ -16,6 +16,7 @@ use strict;
|
||||||
use Tie::IxHash;
|
use Tie::IxHash;
|
||||||
use WebGUI::International;
|
use WebGUI::International;
|
||||||
use WebGUI::Utility;
|
use WebGUI::Utility;
|
||||||
|
use WebGUI::Form::DataTable;
|
||||||
use base 'WebGUI::Asset::Wobject';
|
use base 'WebGUI::Asset::Wobject';
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
@ -102,7 +103,10 @@ Get the YUI DataTable markup and script for this DataTable.
|
||||||
sub getDataTable {
|
sub getDataTable {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
# This method assumes the form control has been prepared
|
if ( !$self->{ _datatable } ) {
|
||||||
|
$self->prepareView;
|
||||||
|
}
|
||||||
|
|
||||||
return $self->{ _datatable }->getValueAsHtml;
|
return $self->{ _datatable }->getValueAsHtml;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -120,8 +124,7 @@ Get the template variables for the raw data. Returns a hash reference with
|
||||||
sub getDataTemplateVars {
|
sub getDataTemplateVars {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
# This method assumes the form control has been prepared
|
my $json = $self->getDataJson;
|
||||||
my $json = $self->{ _datatable }->getValue;
|
|
||||||
my $dt = JSON->new->decode( $json );
|
my $dt = JSON->new->decode( $json );
|
||||||
|
|
||||||
# Make row data more friendly to templates
|
# Make row data more friendly to templates
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue