Home › Forums › Guriddo jqGrid JS › Help › file upload again
Hi Tony:
I know that many ppl have asked why you are not adding a file upload field into modal box. and you have answered that we can integrate file uploader into jqgrid.
but for me, I still dun understand, why can not you just add into modal box. and it posts a file to the backend.
Regards
Xu Ding
Hello,
If you carefully read the changes in 3.5 maybe you will find edittype:'file'
Hello again,
Sorry for this. I really missed this in the docs. Also we have a couple of new editteipes:
Thease types are
button, image and file.
Sorry again
Best Regards
Tony
well,well, what to say ?
awsome !
Hi,Tony
I have tested the edittype: file.
and I found out that it did give me a ,but my doubt is that in it did not post the file from modal box.
Hello,
Yes, the file is not uploaded. As you known uploading a file requiere diffrent approach. I put this in order to be easy use some other plugin like this one:
http://www.phpletter.com/Demo/AjaxFileUpload-Demo/
Regards
Tony
Okay, I see.
Then I think I have already put up the above plugin with jqgrid 3.4 in my demo
page.
Thanks anyways.
Regards
The-Di-Lab
But still I think it won't be very tough to make the modal box to post file out. isn't it ?
Just need to set the
enctype="multipart/form-data", method ="post"
and when add/edit is clicked, it posts the file.
correct me if
Hello,
It is not so easy. Instead that we use form jqGrid post data to the server via ajax. As you known file upload via ajax is not possible, we need to make some trick (use hidden iframe) to do this, but I think it is better to use another plugin.
Best Regards
Tony
Hello Tony,
How would you implement using another plugin within jqgrid? I have an edit field that is part of a larger form and I would like to enable image uploading so how would I even begin to integrate something like that phpletter plugin you linked to?
-Best
RM
Hello,
here is a little code sniplet which works ok in my app using the phpletter plugin
onInitializeForm : function(formid)
{
//These are needed for fileupload plugin
$(formid).attr(“method”,”POST”);
$(formid).attr(“action”,””);
$(formid).attr(“enctype”,”multipart/form-data”);
// Create a button bellow the file field
$(“
“).insertAfter(“#fileToUpload”,formid);
// bind a event
$(“#buttonUpload”,formid).click(function(){
Hi Tony, thank you for the response. It seems that snippet you included might work when the only thing being uploaded is a file and no other fields?
I have a form with a number of text fields as well as a photo, when you click the “edit” button a modal pops up with the various editable fields and a file field (because the photo has edittype: 'file') but the form is not enctype=”multipart/form-data” so no image can be uploaded.
What I'm trying to figure out is this:
1. I have a grid that has an image, a name and a caption
2. There is an edit button that, when clicked opens a modal window with a form to edit those three things
3. This form has a file input field and two text fields
4. You select the image, enter the text, hit submit and everything gets uploaded/updated/added.
Is this just not possible with jqgrid? It seems you can upload a file (using a third-party ajax file upload plugin) or you can handle text fields but you cannot do both in one form with jqgrid. Is this correct?
HEllo,
I think that this is possible using formatters
Regards
Tony
Hello ,
my problem is the same.
i need to upload the file. but at the same time i need file manager.
and it seems like uploading the file using jqGrid is not the solution.
i found 2 solution to upload the file and at the same time using file manager to manage the file.
that is using free plugin
using jqGrid only to save the path to the file.
I'm choosing KcFinder because that plugin doesn't need to create table in dbase. and its preety simple to integrate.
KFM is also a good plugin but i'm not using it because i still don't know how to handle the security problem in CodeIgniter.
so KcFinder it is. its simple.
this my configuration in colModel
,{
Hi Riza
Are you sure that the above code actually works? I tried it using KCfinder and the file uploader appears only when creating the inline form. It appears right on top of the inline form, without asking permission, and it never loads again.
I think I am missing something here, like triggering the uploader too in some other event, but since I am newbie to Jqgrid, I can't figure it out…
Any help out there? Thanks
Gabriel
ajaxFileupload() uses undocumented jquery handleError() method. HandleError was removed in jquery 1.5 .
So this code does not work anymore. Also this does not post other form fields.
Where to find sample which posts file and other form fields also in submit button is clicked in add or edit
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top