onComplete does not work for me with the latest version, has anyone else experienced this issue?
Also, when I include this extension it breaks all of my jquery theming.
Any thoughts?
php:
<?php
$this->widget('ext.xupload.XUploadWidget', array(
'url' => $this->createUrl('/media/upload', array('itemId'=>$item->id)),
'name' => 'file',
'multiple'=>true,
'options' => array(
'sequentialUploads' => true,
'acceptFileTypes' => '/(\.|\/)(gif|jpeg|png)$/i',
'onComplete' => 'js:function (event, files, index, xhr, handler, callBack) {
alert(1);
}',
'formatBytes' => 'js:function (bytes)
{
if (bytes >= 1000000000) {
return (bytes / 1000000000).toFixed(2) + " GB";
}
if (bytes >= 1000000) {
return (bytes / 1000000).toFixed(2) + " MB";
}
if (bytes >= 1000) {
return (bytes / 1000).toFixed(2) + " KB";
}
return bytes + " B";
}',
),
'themeUrl'=>Yii::app()->theme->baseUrl . '/jui-themes',
'theme'=>Yii::app()->params['juiTheme'],
));
?>
generated:
jQuery('#XUploadWidget_form').fileUploadUI({'sequentialUploads':true,'acceptFileTypes':'/(\\.|\\/)(gif|jpeg|png)$/i','onComplete':function (event, files, index, xhr, handler, callBack) {
alert(1);
},'formatBytes':function (bytes)
{
if (bytes >= 1000000000) {
return (bytes / 1000000000).toFixed(2) + " GB";
}
if (bytes >= 1000000) {
return (bytes / 1000000).toFixed(2) + " MB";
}
if (bytes >= 1000) {
return (bytes / 1000).toFixed(2) + " KB";
}
return bytes + " B";
},'uploadTable':'#files','downloadTable':'#files','buildUploadRow':function (file, index) {
return $('<tr>'+
'<td class="filename">'+file[index].name+'</td>'+
'<td class="filesize">'+file[index].name+'</td>'+
'<td class="file_upload_progress"><div></div></td>'+
'<td class="file_upload_start" style="display:none">'+
'<button class="ui-state-default ui-corner-all" title="Start Upload">'+
'<span class="ui-icon ui-icon-circle-arrow-e">Start Upload</span>'+
'</button>'+
'</td>'+
'<td class="file_upload_cancel">'+
'<button class="ui-state-default ui-corner-all">'+
'<span class="ui-icon ui-icon-cancel">Cancel</span>'+
'</button>'+
'</td>'+
'</tr>');
},'buildDownloadRow':function (files, index) {
return $('<tr><td>' + files.name + '<\/td>' +
'<td class="file_upload_progress"><div><\/div><\/td>' +
'<td class="filesize">'+files.size+'</td>' +
'<td class="file_upload_cancel">' +
'<button class="ui-state-default ui-corner-all" title="Cancel">' +
'<span class="ui-icon ui-icon-cancel">Cancel<\/span>' +
'<\/button><\/td><\/tr>');
}});