Enhanced nuResizeBrowseColumns
Posted: Tue Jan 25, 2022 10:35 am
Hello,
I have modified this code which may help in semi responsive browse form, of course there is a lot to be done. Iam sharing this for suggestions, and improvements.
I have modified this code which may help in semi responsive browse form, of course there is a lot to be done. Iam sharing this for suggestions, and improvements.
Code: Select all
function nuResizeBrowseColumns(force){
$(window).bind('load resize',(function() {
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((window.innerWidth - 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;}
nuSetBrowserColumns(w);
})).resize();
}