I am new to extjs, so you need help. I uploaded the image to my db,
sb.append(System.getProperty("java.io.tmpdir")) .append(System.getProperty("file.separator")) .append("temp.jpg"); FileOutputStream fos = new FileOutputStream(sb.toString()); fos.write(myFileService.getImage.getBytes()); // it works ok fos.close(); FileBean fb = new FileBean(); fb.setName("temp.jpg"); fb.setUrl(sb.toString()); res.put("image", fb);
My panel looks like in the examples.
var imgPanel = new Ext.Panel({ padding: 5, margins: '0 0 5 5', id:'images-view', frame:true, collapsible:false, layout:'fit', items: new Ext.DataView({ store: imgStore, tpl: tpl, height:200, width: 200, multiSelect: false, overClass:'x-view-over', itemSelector:'div.thumb-wrap', emptyText: 'No images to display', plugins: [ new Ext.DataView.DragSelector({dragSafe:true}) ],
this is a store
imgStore = new Ext.data.JsonStore({ url: '/foo', root: 'image', fields: [ 'name', 'url' ] });
I get a good answer, but the panel shows the emptyText value, after rebooting the store. Maybe I get the wrong url? if so, how to make it work? I need to save my photo in a temporary file and then show it. I think my problem is server side. How do I save it at the address I need and then get it at that url? Help me pls ....
source share