Skip to content Skip to sidebar Skip to footer

Valums Qq.fileuploader Doesn't Work When It's Initialized After Loading Button By Ajax

I use Valums qq.FileUploader(ex-AjaxUpload) plugin for uploading in my Asp.net mvc 3 application... I have some button in my page add-newimage, and by clicking in it I get modal wi

Solution 1:

I would try to put the uploader code in the open event of your dialog.

$("#add-image").dialog({
  open : function(event, ui) {
      var uploader= new qq.FileUploader({
        element: document.getElementById("upload-image"),
        action: '/Design/UploadImage',
        allowedExtensions: ['jpg'],
        onComplete: function (id, fileName, responseJSON) {
          $("#hidden-path input").html("/Img/Temp/@User.Identity.Name/" + file);
            alert($("#hidden-path input").html());
          }
  }
});

..

$("#add-newimage").click(function () {
  $("#add-image").load('/Design/AddImage/', function () {
    $("#add-image").dialog('open');
  });
});

Post a Comment for "Valums Qq.fileuploader Doesn't Work When It's Initialized After Loading Button By Ajax"