<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
	<title>jQuery Grid Plugin - jqGrid - Topic: jqgrid and the ajax_upload plugin</title>
	<link>http://www.trirand.com/blog/?page_id=393/help/jqgrid-and-the-ajax_upload-plugin</link>
	<description><![CDATA[Grid plugin]]></description>
	<generator>Simple:Press Version 5.7.5.3</generator>
	<atom:link href="http://www.trirand.com/blog/?page_id=393/help/jqgrid-and-the-ajax_upload-plugin/rss" rel="self" type="application/rss+xml" />
        <item>
        	<title>phicarre on jqgrid and the ajax_upload plugin</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/jqgrid-and-the-ajax_upload-plugin#p12553</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/jqgrid-and-the-ajax_upload-plugin#p12553</guid>
        	        	<description><![CDATA[<p>Mark,</p>
<p>Is it possible to see your solution ? mine doesn&#39;t work.</p>
<p>var upload;</p>
<p>...</p>
<p>onInitializeForm: function (formid)<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; var cppass = &#39;&#60;tr id="tr_fileupload" class="FormData" rowpos="4"&#62;&#39;;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; cppass += &#39;&#60;td class="CaptionTD ui-widget-content"&#62;Photo&#60;/td&#62;&#39;;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; cppass += &#39;&#60;td class="DataTD ui-widget-content" style="white-space: pre;"&#62;&#39;;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; cppass += &#39; &#60;input id="fileupload" class="FormElement" type="file" name="fileupload" size="20"/&#62;&#39;;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; cppass += &#39;&#60;/td&#62;&#60;/tr&#62;&#39;;<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $(cppass).insertAfter("#tr_sexe",formid);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; upload = new AjaxUpload(&#39;#fileupload&#39;,{action: &#39;upload.php&#39;});<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }</p>
<p>...</p>
<p>beforeSubmit: function (aData,formid)<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; {<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; upload.setData(aData);<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; upload.submit();<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; return [true,&#39;&#39;];<br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; },</p>
]]></description>
        	        	<pubDate>Sat, 28 Nov 2009 20:07:48 +0200</pubDate>
        </item>
        <item>
        	<title>markw65 on jqgrid and the ajax_upload plugin</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/jqgrid-and-the-ajax_upload-plugin#p12543</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/jqgrid-and-the-ajax_upload-plugin#p12543</guid>
        	        	<description><![CDATA[<p>I think you&#39;re going to have to turn it around, and post the grid data via ajaxfileupload.</p>
</p>
<p>So in your beforeSubmit function, you&#39;re going to have to copy the postdata to the file upload plugin, and the submit that.</p>
</p>
<p>Not sure which file uploader you&#39;re using. I&#39;ve used the one from <a href="http://valums.com/ajax-upload/" rel="nofollow" target="_blank">http://valums.com/ajax-upload/</a>. With that you would just do:</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit3416' value='Select Code' data-codeid='sfcode3416' /></p>
<div class='sfcode' id='sfcode3416'>
<p>uploader.setData(postdata);</p>
<p>uploader.submit();</p>
</div>
<p>But then you would need to prevent the grid from submitting your request too... there doesnt seem to be an easy way to do that. But you /could/ return [false, "OK"] from beforeSubmit. The problem with that is that the grid would put "OK" into the error field - so you would need to hide the error field immediately.</p>
</p>
<p>I think you could do that with a setTimeout at the end of your beforeSubmit.</p>
</p>
<p>so (untested, but probably close):</p>
</p>
<p><input type='button' class='sfcodeselect' name='sfselectit7737' value='Select Code' data-codeid='sfcode7737' /></p>
<div class='sfcode' id='sfcode7737'>
<p>beforeSubmit : function(postdata,form) {</p>
<p>&#160;&#160;&#160; uploader.setData(postdata);</p>
<p>&#160;&#160;&#160; uploader.submit();</p>
<p>&#160;&#160;&#160; setTimeout(function() { $("#FormError",form).hide() },0);</p>
<p>&#160;&#160;&#160; return [false,"OK"];</p>
<p>&#160; }</p>
</div>
<p>Mark</p>
]]></description>
        	        	<pubDate>Fri, 27 Nov 2009 18:45:46 +0200</pubDate>
        </item>
        <item>
        	<title>phicarre on jqgrid and the ajax_upload plugin</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/jqgrid-and-the-ajax_upload-plugin#p12540</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/jqgrid-and-the-ajax_upload-plugin#p12540</guid>
        	        	<description><![CDATA[<p>Ok, in onItinializeForm, I added the field of type "file". The form layout is correct.</p>
<p>in onclickSubmit, I supposed to get the value of this field and append it to the postdata.</p>
<p>&#60;input id="fileupload" class="FormElement" type="file" name="fileupload" size="20"/&#62;&#39;;</p>
<p>How to get the value ? I tried postdata.fileupload but this gives "undefined"</p>
<p>in beforeSubmit, I tried to get the value:</p>
<p>beforeSubmit: function (aData,formid)</p>
<p>{</p>
<p>alert(aData.fileupload);&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#60;---- this gives "undefined"&#160;&#160;&#160;&#160; Normal because the index doesn&#39;t exist ?!</p>
<p>...</p>
<p>I also tried $("#fileupload",formid).val() but this gives "undefined"</p>
</p>
<p>That was the first problem ...</p>
<p>The second problem is the coexistance between the url of editGridRow and the url of the $.ajaxfileupload plugin.</p>
<p>How to send the data of the form + the extra data with only one url ?</p>
]]></description>
        	        	<pubDate>Fri, 27 Nov 2009 17:34:12 +0200</pubDate>
        </item>
        <item>
        	<title>phicarre on jqgrid and the ajax_upload plugin</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/jqgrid-and-the-ajax_upload-plugin#p12535</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/jqgrid-and-the-ajax_upload-plugin#p12535</guid>
        	        	<description><![CDATA[<p>The problem is to implement it with other fields in the same form &#8230;</p>
<p>But I think I understood with your answer about "not defined field". I&#39;ll try</p>
]]></description>
        	        	<pubDate>Fri, 27 Nov 2009 12:01:48 +0200</pubDate>
        </item>
        <item>
        	<title>tony on jqgrid and the ajax_upload plugin</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/jqgrid-and-the-ajax_upload-plugin#p12504</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/jqgrid-and-the-ajax_upload-plugin#p12504</guid>
        	        	<description><![CDATA[<p>Hello,</p>
<p>Maybe you will need to use onInitializeForm event to attach this feature.</p>
<p>Regards</p>
<p>Ton</p>
]]></description>
        	        	<pubDate>Fri, 27 Nov 2009 04:06:09 +0200</pubDate>
        </item>
        <item>
        	<title>phicarre on jqgrid and the ajax_upload plugin</title>
        	<link>http://www.trirand.com/blog/?page_id=393/help/jqgrid-and-the-ajax_upload-plugin#p12410</link>
        	<category>Help</category>
        	<guid isPermaLink="true">http://www.trirand.com/blog/?page_id=393/help/jqgrid-and-the-ajax_upload-plugin#p12410</guid>
        	        	<description><![CDATA[<p>Tony suggests to use another plugin for the file uploading.</p>
<p>e.g: ajax_upload</p>
<p>I didn&#39;t find how to use it in form editing.</p>
<p>Any helps ?</p>
]]></description>
        	        	<pubDate>Wed, 25 Nov 2009 05:37:51 +0200</pubDate>
        </item>
</channel>
</rss>