Closed re1naldo closed 10 years ago
The settings are wrong, you should set the events
attribute https://github.com/2amigos/yiiwheels/blob/master/widgets/fineuploader/WhFineUploader.php#L38 and not within the pluginOptions
Sorry, I thought events attribute should be set like normal plugin options. So, here is the working one:
$this->widget('yiiwheels.widgets.fineuploader.WhFineUploader', array(
'name'=>'picture-upload',
'uploadAction'=>$this->createUrl('user/upload', array('id'=>$model->id)),
'events'=>array(
'submit'=>"function() { alert('xx'); }",
'complete'=>"function() { alert('xx'); }",
),
'pluginOptions'=>array(
'validation'=>array(
'allowedExtensions'=>array('jpeg', 'jpg', 'gif', 'png')
),
)
));
Many thanks for your help, Antonio.
How do we configure events for WhFineUploader? I tried this code, but it didn't work:
'onSubmit' and 'onComplete' events were not fired, but file uploading worked fine. Am I doing anything wrong?