Mojolicious-Plugin-DevexpressHelpers

 view release on metacpan or  search on metacpan

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

The following syntaxe allow to specify all options from a javascript object.
B<Note: It will ignore all other options specified in the hash reference.>

	%= dxdatagrid myId, { options => 'JSFrameWork.gridsOptions.myResource' }

=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');
	mk_dxcontrol('dxLookup');
	mk_dxcontrol('dxSelectBox');

In your template:

	%= dxnumberbox 'age' => $value => 'Age: ', { placeHolder => 'Enter your age' }
	%= dxswitch 'mySwitch' => $boolean_value => 'Enabled: '
	%= dxtextbox 'name' => $value => 'Name: ', { placeHolder => 'Type a name' }
	%= dxlookup 'name' => $value => 'Name: ', { dataSource => $ds, valueExpr=> $ve, displayExpr => $de }
	%= dxselectbox 'name' => $value => 'Name: ', { dataSource => $ds, valueExpr=> $ve, displayExpr => $de }

=head2 dxbuild C<[ js_prefix => '$(function(){', js_sufix => '});' ]>

Build the binding between jQuery and divs generated by plugin helpers such as dxbutton.
It is should to be called in your template just before you close the body tag.
Optional named argument C<js_prefix> and C<js_sufix> can be specified to override
standard javascript wrapper.

	<body>
		...
		%= dxbuild
	</body>

=head2 require_asset @assets

Used to specify one or more assets dependencies, that will be appended on call to required_assets.
This function need 'AssetPack' plugin to be configurated in your application.

in your template:

	<body>
		...
		%= require_asset 'MyScript.js'
		...
	</body>

in your layout:

	<head>
		...
		%= required_assets
		...
	</head>

=head2 required_assets

Add assets that was specified by calls to require_asset.
See require_asset for usage.

=head2 prepend_js

Prepend javascript code to dx-generated code

	append_js 'alert("before dx-controls initialisation");'

=head2 append_js 

Append javascript code to dx-generated code

	append_js 'alert("after dx-controls initialisation");'

=head2 register

Register our helpers

=head1 AUTHOR

Nicolas Georges <xlat@cpan.org>

=head1 COPYRIGHT AND LICENSE

This software is Copyright (c) 2015 by Nicolas Georges.

This is free software, licensed under:

  The MIT (X11) License

=cut



( run in 1.699 second using v1.01-cache-2.11-cpan-6aa56a78535 )