Mojolicious::Plugin::DevexpressHelpers::Helpers - Helpers for Devexpress controls are defined here
version 0.163572
Output string in template
out '<div id="'.$id.'"></div>';
Internal usage.
my $dxHelper = Mojolicous::Plugin::DevexpressHelpers::Helpers->new; $c->stash( dxHelper => $dxHelper );
$dxHelper->indent_binding( 1 );
$dxHelper->add_binding($binding, [$binding2,...] );
my $next_id_number = $dxHelper->next_id;
my $new_id = $dxHelper->new_id;
dxbind( $c, 'dxButton' => $id => $attrs, \@extensions);
Produce a div tag with an computed id, which will be binded to a dxButton with $attrs attributs at call to dxbuild.
$attrs
Internal usage
my $attrs = parse_attributs( $c, \@implicit_arguments, @attributs )
$id, \@items ,[ \%options ]
%= dxmenu mainMenu => [{ id => 1, text => 'Back', iconSrc => '/images/back.png', link => 'javascript:location.back();' }], \q% function(e){return e.itemData.link;} %
[ $id, [ $message ] ], [ \%options ]
%= dxloadpanel myLoadPanel => 'Please wait'
[ $id, [ $text, [ $onclick ] ] ], [ \%options ]
%= dxbutton myButtonId => 'My button' => q{ function (){ alert('onClick!'); } } %= dxbutton undef, 'My button' => '/some/url' %= dxbutton { id => myId, text => 'My button', onClick => q{ function (){ alert('onClick!'); } }, type => 'danger', icon => 'user' };
[ $id, [ $datasource, ] ] [ \%opts ]
%= dxdatagrid 'myID' => '/products.json', { columns => [qw( name description price )] } %= dxdatagrid undef, '/products.json' %= dxdatagrid { id => myId, dataSource => '/products.json' }
The following syntaxe allow to specify all options from a javascript object. Note: It will ignore all other options specified in the hash reference.
%= dxdatagrid myId, { options => 'JSFrameWork.gridsOptions.myResource' }
[ $id, [ $formData, [ \@itemsSpecs ], [ \%opts ] ] ]
%= dxform myForm => \%formData; %= dxform myForm => \%formData, { colCount => 2 }; %= dxform myForm => \%formData, \%itemsSpecs; %= dxform myForm => \%formData, \%itemsSpecs, { colCount => '3' };
[ $id, [ $title, [ $contentTemplate, ] ] ], [\%opts]
%= dxpopup myPopupID => 'Popup Title', \q{function(contentElement){ contentElement.append('<p>Hello!</p>'); }};
$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 }
[ js_prefix =
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 js_prefix and js_sufix can be specified to override standard javascript wrapper.
js_prefix
js_sufix
<body> ... %= dxbuild </body>
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>
Add assets that was specified by calls to require_asset. See require_asset for usage.
Prepend javascript code to dx-generated code
append_js 'alert("before dx-controls initialisation");'
Append javascript code to dx-generated code
append_js 'alert("after dx-controls initialisation");'
Register our helpers
Nicolas Georges <xlat@cpan.org>
This software is Copyright (c) 2015 by Nicolas Georges.
This is free software, licensed under:
The MIT (X11) License
To install Mojolicious::Plugin::DevexpressHelpers, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mojolicious::Plugin::DevexpressHelpers
CPAN shell
perl -MCPAN -e shell install Mojolicious::Plugin::DevexpressHelpers
For more information on module installation, please visit the detailed CPAN module installation guide.