jquery ui - JqGrid : File Upload not working -


i trying upload file jqgrid, mistake in code. using oninitializeform method. using jquery ajax file uploader can me? can see error in screenshot

screenshot code.

    jquery("#formgrid").jqgrid(                 {                     url:'application/ajax/common_form_detail.php?form_id='+form_id,                     editurl:'application/ajax/common_form_edit.php?form_id='+form_id,                     datatype: "json",                     colnames:[<?php echo $strfield; ?>],                     colmodel:[<?php echo $strfieldmodel; ?>],                         rownum:20,                         rowlist:[20,50,100],                         pager: '#formcontrol',                         sortname: 'id',                         viewrecords: true,                         sortorder: "asc",                         autowidth: true,                         height: 400,                         width: 900                 });                 jquery("#formgrid").jqgrid('navgrid','#formcontrol',                 { edit:true,add:true,del:true,search:false},                 {width:780,recreateform:true},                 {width:780,recreateform:true                     ,oninitializeform : function(formid){                     $(formid).attr('method','post');                     $(formid).attr('action','');                     $(formid).attr('enctype','multipart/form-data');                 }, aftersubmit : function(response, postdata){                        $.ajaxfileupload({                           url: 'application/ajax/common_file_upload.php',                            secureuri:false,                           fileelementid:'student_avatar',                           datatype: 'json',                           success: function (data, status) {                               alert("upload complete.");                           }                        });                    } });  }); 

one can see have error in jquery.handleerror function depreciated jquery 1.5. jquery ajax file uploader v2.1 provided download page included jquery 1.2.1.

one have fix code of ajax file uploader solve problem. see the answer , the answer example or this one. can consider use plugin file upload jquery form plugin (and here), see here.


Comments