Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

resizing browse form to fit webbrowser window

Questions related to using nuBuilder Forte.
Andrea
Posts: 29
Joined: Sun Jan 02, 2022 10:18 am
Been thanked: 1 time

Re: resizing browse form to fit webbrowser window

Unread post by Andrea »

There seems to be a little bug in your code. If I show the browser window in window mode and maximize it all resizes fine, but if I repeat this a several times part of the browse form get out of the window.

Perhaps it would be easier to set the column sizes depending on screen width, independent of window width?
kev1n
nuBuilder Team
Posts: 4380
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 74 times
Been thanked: 464 times
Contact:

Re: resizing browse form to fit webbrowser window

Unread post by kev1n »

Here's a slightly modified nuResizeBrowseColumns():

Code: Select all

function nuResizeBrowseColumns(force){

	var w	= nuArrayColumn(nuSERVERRESPONSE.browse_columns,'width').map(Number);
	var t	= 0;
	var p	= nuTotalWidth('nucell_0_0') - $('#nucell_0_0').width();	//-- padding

	if((nuFORM.getCurrent().refreshed != 0 && force !== true)  && nuMainForm()){return;}

	if(nuMainForm()){

		for(var i = 0 ; i < w.length ; i++){
			t = t + w[i];
		}

		for(var i = 0 ; i < w.length ; i++){
			w[i] = parseInt((document.documentElement.clientWidth - 30) * w[i] / t) - p;
		}

	}else{

		var W	= nuTotalWidth('nuBrowseFooter') + 22;

		$('#nuDragDialog',	window.parent.document).css('width', W + 14);
		$('#nuWindow',		window.parent.document).css('width', W);

		$('body').css('width', W);

	}

	if(nuFORM.getCurrent().refreshed != 0 && force !== true){return;}
	console.log('nuResizeBrowseColumns 2')

	nuSetBrowserColumns(w);

}
BTW: Thanks for your generous donation Andrea! Really kind of you.
Andrea
Posts: 29
Joined: Sun Jan 02, 2022 10:18 am
Been thanked: 1 time

Re: resizing browse form to fit webbrowser window

Unread post by Andrea »

Now it's perfect! :thumb:
Many thanks for your very good work!
Best wishes

Andrea
Post Reply