Hello,
I am trying to add SimpleCropper plugin (https://github.com/tomazdragar/SimpleCropper) to Grocery Crud edit form but I have a problem, file browser doesn't open.
What I did is the following:
- I load all the files necesary in the header.
<script src='....assets/backoffice/plugins/jquery-1.11.js'></script> <script src='....assets/backoffice/js/jquery.Jcrop.js'></script> <script src='....assets/backoffice/js/jquery.SimpleCropper.js'></script>
- I initialize the plugin
<script> $('.cropme').simpleCropper(); </script>
- In the controler function I use callback_edit_field to convert the input to the div I need.
$this->grocery_crud->callback_edit_field('portfolio_image', array($this, 'cropper'));
- cropper function is:
function cropper() { $div = '<div class="cropme" style="width: 400px; height: 200px; position: relative;"></div>'; return $div; }
All seems to be ok, the files are loaded and the div is created but nothing happen, when I click on the div, the files browser is not opened. I have no error on firebug and I don't know why it does not work.
I imagine something is wrong with GC because this plugin is very simple to use but I don't know what.
Thank for help.
More info: http://www.jqueryscript.net/other/jQuery-Canvas-Based-Image-Cropping-Plugin-Simple-Cropper.html