@Gabi
Thanks for your earlier code samples, as I have now managed to get a form to appear when I double click on a cell in my grouping grid (set to editType=Form).
The save works fine for a text field, but when I try to use it for an image/media, the 'save' doesn't work!
I duplicated the working 'text' form to create one for images, with the form variable set to type 'Media' in the variable editor.
I use the 'File Upload' component on the form to allow selecting an image, as well as having an 'Image' component to display the image (just so I can be sure it has actually loaded)
This does the save in the same way
- Code: Select all
forms.mobilePlotQCR.elements.table.setFormEditorValue(fv_photo);
forms.mobilePlotQCR.elements.table.stopCellEditing();
fv_photo has the image either passed from the grid if the row had an image set in the database, or shows a new image if one is chosen via uploader.
But nothing gets set in database when the form is saved/closed
Once again this seems to be a frustrating case of a lack of decent documentation/examples of how to do things, or if something isn't supported (like saving images??)
I wouldn't have been able to get anywhere with this if not for this post, but now I am stuck trying to do something that should (hopefully) work...
(BTW, on the subject of the documentation, the Wiki page
https://github.com/Servoy/aggridcomponents/wiki/Data-Griddocuments the Grouping Table Events as having params
- Code: Select all
foundsetIndex:Number, columnIndex:Number, oldValue:Object, newValue:Object, event:JSEvent, record:Object
but if you let Servoy create the method for this it misses out the 'record' parameter, which, once added in manually did work correctly & returned the correct record [I am using the grid by default in Grouped mode, but have tested the above issues in grouped & ungrouped with same issue] )
I hope that I am actually able to work with images & get the form editor to allow me to save them, or advise me how I can do it easily in the grouping grid.
Thanks
Rafi