Mojolicious-Plugin-DevexpressHelpers

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

0.151550_000 2015-06-04 13:20:25+02:00 Europe/Paris (TRIAL RELEASE)
        Add dxmenu helper
0.151530  2015-06-02 16:12:27+02:00 Europe/Paris
        Add dxlookup helper
0.151480  2015-05-28 12:14:46+02:00 Europe/Paris
        Decode ByteStream to utf-8 characters by default
        Take in account dot in id for jquery
        Add more dx-controls.
        Review prereqs
0.151410  2015-05-21 16:13:14+02:00 Europe/Paris
        Add dxpopup helper, modify API to introduce id parameters.
0.01    2015-05-04 17:05:22+02:00 Europe/Paris
        First version, released on an unsuspecting world.

MANIFEST  view on Meta::CPAN

META.yml
Makefile.PL
README
dist.ini
lib/Mojolicious/Plugin/DevexpressHelpers.pm
lib/Mojolicious/Plugin/DevexpressHelpers/Helpers.pm
t/00-load.t
t/dxbind-prepend.t
t/dxbutton.t
t/dxdatagrid.t
t/dxpopup.t
t/dxtextbox.t
t/fixtures/js/other-framework.js
t/fixtures/js/test-framework.js
t/manifest.t
t/pod-coverage.t
t/pod.t
t/release-pod-coverage.t
t/release-pod-syntax.t
t/require_asset.t
xt/boilerplate.t

lib/Mojolicious/Plugin/DevexpressHelpers/Helpers.pm  view on Meta::CPAN


sub dxform{
	my $c = shift;
	my $attrs = parse_attributs( $c, [qw(id %formData @items)], @_ );
	my $id = delete($attrs->{id}) // new_id( $c, $attrs );
	
	dxbind( $c, 'dxForm' => $id => $attrs );
}


sub dxpopup{
	my $c = shift;
	my $attrs = parse_attributs( $c, [qw(id title contentTemplate)], @_ );
	my $id = delete($attrs->{id}) // new_id( $c, $attrs );
	
	dxbind( $c, 'dxPopup' => $id => $attrs );
}



sub mk_dxcontrol{

lib/Mojolicious/Plugin/DevexpressHelpers/Helpers.pm  view on Meta::CPAN

=head2 dxform C<[ $id, [ $formData, [ \@itemsSpecs ], [ \%opts ] ] ]>

	%= dxform myForm => \%formData;
	
	%= dxform myForm => \%formData, { colCount => 2 };
	
	%= dxform myForm => \%formData, \%itemsSpecs;
	
	%= dxform myForm => \%formData, \%itemsSpecs, { colCount => '3' };

=head2 dxpopup C<[ $id, [ $title, [ $contentTemplate, ] ] ], [\%opts]>

	%= dxpopup myPopupID => 'Popup Title', \q{function(contentElement){
			contentElement.append('<p>Hello!</p>');
		}};

=head2 mk_dxcontrol C<$dxControlName>

In this package:

	mk_dxcontrol('dxNumberBox');
	mk_dxcontrol('dxSwitch');
	mk_dxcontrol('dxTextBox');

t/dxpopup.t  view on Meta::CPAN


# Test
my $t = Test::Mojo->new;

# GET / default
$t->get_ok('/')
  ->status_is(200)
  ->element_exists('html body div[id=dxctl1]')
  ->text_is('script' => q{$(window).on("load",function(){
$("#dxctl1").dxPopup({contentTemplate: "Sample content",
title: "Test popup"});
});});

done_testing;

__DATA__
@@ index.html.ep
% layout 'main';
%= dxpopup undef, 'Test popup' => 'Sample content'

@@ layouts/main.html.ep
<!doctype html>
<html>
    <head>
       <title>Test</title>
    </head>
    <body><%== content %>
%= dxbuild
</body>



( run in 0.994 second using v1.01-cache-2.11-cpan-364913b4093 )