Hexagon Geospatial
MENU

Developer Discussions

Discuss topics with other Hexagon Geospatial Power Portfolio developers and experts to get the most out of our products.
Showing results for 
Search instead for 
Do you mean 
Reply
Highlighted
Regular Contributor
Posts: 158
Registered: ‎07-27-2016
Accepted Solution

$GP.ui.browser.show size

[ Edited ]

Hi Guys,

 

Is there anyway of resizing the $GP.ui.browser.show window?

 

Kind Regards

Jacques

Technical Evangelist
Posts: 804
Registered: ‎09-11-2015

Re: $GP.ui.browser.show size

Hi Jacques,

 

As there's no direct property that you could use in this function, you will need to get the window ExtJS object after it was rendered. Unfortunately it seems like the callback isn't working properly for this case, so I had to add setTimeout function to wait few miliseconds until the component is rendered. But it may behave differently on your end.

 

var browserConfig = {
    title: "Some Title",
    html: "<html><body><h1>This is custom html content.</h1></body></html>"
};

$GP.ui.browser.show(browserConfig, function(res) {
    setTimeout(function(){
         var window = Ext.getCmp(res[0].id).setSize(300,300) 
    }, 100);
});
Jan Neumann
Post Sales Engineer Web Applications
Hexagon Geospatial

Regular Contributor
Posts: 158
Registered: ‎07-27-2016

Re: $GP.ui.browser.show size

[ Edited ]

Hi Jan,

 

Thanks for the workaround.

I ended up using a different approach just short of your feedback.

 

See below:

 

var ForeCast_x = new Ext.Window({
   id: 'WeatherForeCastWindow',
   title: '8 Day Weather Forecast',
   renderTo: 'GeoWeather', //--DIV added in ASPX page--
   layout: 'fit',
   x: 300,
   y: 200,
   width: 700,
   height: 250,
   resizable: true,
   closeAction: 'hide',
   html: '<iframe id="newval" src="ForeCast.htm" width="700px" height="250px" scrolling="no" ></iframe>', //==page in project==
   plain: true,
   cls: 'white'
});
 

// Then just injected ifarme src:
$('#newval').attr('src', "ForeCast.htm?CityID=" + data.id)
//==SHOW FORM==
var win = Ext.getCmp('WeatherForeCastWindow');
win.show();

 

Kind Regards

Jacques

Technical Evangelist
Posts: 804
Registered: ‎09-11-2015

Re: $GP.ui.browser.show size

Hi Jacques,

 

Your way is actually "cleaner" since it doesn't manipulate existing objects and doesn't use any workarounds ;-)

 

Regards,

Jan

Jan Neumann
Post Sales Engineer Web Applications
Hexagon Geospatial

Regular Contributor
Posts: 158
Registered: ‎07-27-2016

Re: $GP.ui.browser.show size

Yeah well , you did answer my question on how to resize $GP.ui.browser and your method will , so thanks Smiley Happy

Do you need immediate support?
Please submit a Ticket through our
Development Ticket Portal.