[Users] dynamically display an image in an ext panel

Robert Buckley robertdbuckley at yahoo.com
Wed Mar 30 19:16:25 CEST 2011


Hi,

I have a GeoExt.grid linked fieldset which populates a form. The form is 
populated when I select a row from an ext.grid using the getSelectionModel() 
code displayed below.

                 var popfieldset = function(){
                    gridPanel.getSelectionModel().each(function(rec){
                        var feature = rec.get("feature");
                        InfoPanel.getForm().loadRecord(rec);
                        
mapPanel.map.setCenter(feature.geometry.getBounds().getCenterLonLat(), 12);
                    })
                };

Within the form I would like to display an image whose relative url is also in 
the postgresql db which serves the attribute data.

To dynamically change the image I would like to substitute the path below 
(../images/wea_bild.jpg) with a variable which 

reads contents of the postgis column ("wea_bild"), but i´ve can´t work out how 
to do it.

                   ,
                    { xtype: 'box',
                    autoEl: { tag: 'div', style: 'padding-bottom:20px',
                    html: '<img id="pic" src="../images/wea_bild.jpg" />'}
                    }


Can anyone give me a clue?

yours,

Robert




More information about the Users mailing list