PDA

View Full Version : Integrating fileupload control in RowBody (ext js 4.0.7)



offtopic
29 Jun 2013, 11:02 PM
I have to extend a grouped grid with a file upload within an (existing) row body feature. I have already implemented an textarea (simple html) in this row body. But now i have problems to integrate the file upload.

Till now i have used an ajax request to post the data to the server, but now i have to change to a form panel with integrated file upload controls.

I need to attach an upload control to each row to send the whole data within the grid and the file data (multi part request).
I can add the file upload control with Ext.create ... renderTo to display the file selection control within the row body. But the control is not part of the form (no field).

Has anyone an hint how to achieve this?

slemmon
30 Jun 2013, 10:43 PM
Are you creating and entire formPanel with file field in the rowbody (including a URL config by which to communicate back to your server)?

offtopic
30 Jun 2013, 10:52 PM
Are you creating and entire formPanel with file field in the rowbody (including a URL config by which to communicate back to your server)?

Yes I create a form panel and submit the form to the server.


this.wizard.getForm().submit({ url: 'someurl' timeout: 120000,..});


I tried to hack (just 4 testing) the form fields to a inner control of the form and tried to dynamically move the file control to the rowbody



Ext.get("ExtBox1-ext-gen1630").appendChild(Ext.get('sujet0'))

<div id="ExtBox1-ext-gen1630" class="x4-grid-rowbody">
<div class="x-editable comments" editortype="textarea" name="comment" id="ExtBox1-ext-gen1634" style="">Comment/Placement</div><
/div>


It works "basically", but the rowbody is re-rendered if I edit another input element within the grid -> input control disappears.