Commit c555825f authored by spawar's avatar spawar

Added changes for fix the table header while body scroll.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@100101 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 38350a25
......@@ -936,7 +936,7 @@ function sidebar()
"</h3>"+
"<div style='padding: 0.8em 0.8em;' >"+
"<div id='suppDtlDiv"+x+"' style='height: 180px; overflow: auto; margin-left: 0px; width:100%;'>"+
"<div id='suppDtlDiv"+x+"' style='height: 270px; overflow: hidden; margin-left: 0px; width:100%;'>"+
"<table id='itemDtl' border='0' style='text-align: center;'>"+
"<tr>"+
......@@ -1127,7 +1127,7 @@ function setColumnValues( retVal )
if (x[i].childNodes[0] != undefined)
{
tr = tr + "<tr style='text-align: center;'>";
tr = tr + "<tr class='tdClass' style='text-align: center;'>";
for (var j = 0; j < y.length; j++)
{
......@@ -1281,14 +1281,23 @@ function setColumnValues( retVal )
//Changed by samadhan on 30/06/2015 D15CKAT026 End
}
}
var a = "<table class='tableClass' id='itemDtl"+y+"' width='100%' style='text-align: left;'>" +
//Changed by samadhan on 03/02/2015 for fixed matxix table header Start
/* var a = "<table class='tableClass' id='itemDtl"+y+"' width='100%' style='text-align: left;'>" +
"<thead><tr class='thClass' style='text-align:center;'>"+
pSetVal
+"</tr></thead>" +
"<tbody class='table-body'>" +
"</tbody>" +
"</table>";
"</table>"; */
var tempdata="<div id='matrixDiv"+y+"'><table id='itemDtl"+y+"' width='100%' class='mt'>"+
"<tr class='thClass' style='text-align:center;'>"
+pSetVal+
"</tr>"
+tr+
"</table></div>";
//Changed by samadhan on 03/02/2015 for fixed matxix table header End
/*
window.opener.document.getElementById("itemDtlDiv").innerHTML = a;
......@@ -1298,11 +1307,16 @@ function setColumnValues( retVal )
//alert("active="+y);
//alert("X="+x);
//Changed by samadhan on 03/02/2015 for fixed matxix table header Start
//$('#itemDtl'+y, window.opener.document).remove();
//$('#suppDtlDiv'+y, window.opener.document).append(a);
//$('#itemDtl'+y+' tbody', window.opener.document).append(tr);
$('#itemDtl'+y, window.opener.document).remove();
$('#suppDtlDiv'+y, window.opener.document).append(a);
$('#itemDtl'+y+' tbody', window.opener.document).append(tr);
$('#matrixDiv'+y, window.opener.document).remove();
$('#suppDtlDiv'+y, window.opener.document).append(tempdata);
fxheaderInit("itemDtl"+y,200);
//Changed by samadhan on 03/02/2015 for fixed matxix table header End
//Changed by samadhan on 30/06/2015 D15CKAT026 Start
//window.opener.document.getElementById("display."+t+"").innerHTML = "0";
if (tranType == "T")
......@@ -2107,7 +2121,7 @@ function sidebarMulti()
"</h3>"+
"<div style='padding: 0.8em 0.8em;' >"+
"<div id='suppDtlDiv"+x+"' style='height: 180px; overflow: auto; margin-left: 0px; width:100%;'>"+
"<div id='suppDtlDiv"+x+"' style='height: 270px; overflow: hidden; margin-left: 0px; width:100%;'>"+
"<table id='itemDtl' border='0' style='text-align: center;'>"+
"<tr>"+
......@@ -2234,7 +2248,7 @@ function sidebarNew()
"</h3>"+
"<div style='padding: 0.8em 0.8em;' >"+
"<div id='suppDtlDiv"+x+"' style='height: 180px; overflow: auto; margin-left: 0px; width:100%;'>"+
"<div id='suppDtlDiv"+x+"' style='height: 270px; overflow: hidden; margin-left: 0px; width:100%;'>"+
"<table id='itemDtl' border='0' style='text-align: center;'>"+
"<tr>"+
......@@ -2429,7 +2443,7 @@ function setColumnValuesNew( retVal )
if (x[i].childNodes[0] != undefined)
{
tr = tr + "<tr style='text-align: center;'>";
tr = tr + "<tr class='tdClass' style='text-align: center;'>";
var qtytr = 0;
for (var j = 0; j < y.length; j++)
{
......@@ -2551,16 +2565,30 @@ function setColumnValuesNew( retVal )
}
}
}
var a = "<table class='tableClass' id='itemDtl"+y+"' width='100%' style='text-align: left;'>" +
//Changed by samadhan on 03/02/2015 for fixed matxix table header Start
/*var a = "<table class='tableClass' id='itemDtl"+y+"' width='100%' style='text-align: left;'>" +
"<thead><tr class='thClass' style='text-align:center;'>"+
pSetVal
+"</tr></thead>" +
"<tbody class='table-body'>" +
"</tbody>" +
"</table>";
$('#suppDtlDiv'+y, document).append(a);
$('#itemDtl'+y+' tbody', document).append(tr);
"</table>";*/
var tempdata="<div id='matrixDiv"+y+"'><table id='itemDtl"+y+"' width='100%' class='mt'>"+
"<tr class='thClass' style='text-align:center;'>"
+pSetVal+
"</tr>"
+tr+
"</table></div>";
//Changed by samadhan on 03/02/2015 for fixed matxix table header End
//Changed by samadhan on 03/02/2015 for fixed matxix table header Start
//$('#suppDtlDiv'+y, document).append(a);
//$('#itemDtl'+y+' tbody', document).append(tr);
$('#matrixDiv'+y, document).remove();
$('#suppDtlDiv'+y, document).append(tempdata);
fxheaderInit("itemDtl"+y,200);
//Changed by samadhan on 03/02/2015 for fixed matxix table header End
var totalQty = 0;
for (var p=1;p< fx;p++)
......@@ -2579,5 +2607,167 @@ function setColumnValuesNew( retVal )
//Changed by samadhan on 14/07/2015 for previous button work call End
//Changed by samadhan on 03/02/2015 for fixed matxix table header Start
var flag=false;
var tid; //table id as defined on html page
var sheight;
var itmNum;
function ge$(d)
{
//alert(d);
try
{
return window.opener.document.getElementById(d);
}
catch(e)
{
try
{
return document.getElementById(d);
}catch(e)
{
try
{
return window.document.getElementById(d);
}
catch(e)
{
//alert("ex");
}
}
}
}
function scrollHeaderNew(dscroll,hscroll)
{
// alert(flag);
if(flag)
{
return;
}
var fh=ge$(hscroll);
var sd=ge$(dscroll);
try
{
fh.style.left=(0-sd.scrollLeft)+'px';
}
catch(e)
{
}
//alert("3333");
}
function scrollHeader()
{
// alert("99999");
if(flag)
{
return;
}
var fh=ge$('Scroller:fx'+itmNum+'');
var sd=ge$(tid+':scroller');
fh.style.left=(0-sd.scrollLeft)+'px';
}
function addScrollerDivs()
{
// alert("0000");
//alert(ge$(tid+':scroller'));
if(ge$(tid+':scroller'))
{
return;
}
//alert("1111111");
var tempDiv = document.createElement("div");
var sd=document.createElement("div");
var tb=ge$(tid);
sd.style.height=sheight+"px";
sd.style.overflow='visible';
sd.style.overflowX='auto';
sd.style.overflowY='auto';
sd.style.width=tb.width;
sd.id=tid+':scroller';
sd.className='second';
var hScroll = 'Scroller:fx'+itmNum;
var dScroll = tid+':scroller';
sd.setAttribute('onscroll', "scrollHeaderNew('"+dScroll+"','"+hScroll+"');");
//sd.onscroll = scrollHeader;
//alert("22222");
var tb2=tb.cloneNode(true);
sd.appendChild(tb2);
tb.parentNode.replaceChild(sd,tb);
var sd2=document.createElement("div");
sd2.id='Scroller:fx'+itmNum+':OuterDiv';
sd2.style.cssText='position:relative;width:100%;overflow:hidden;overflow-x:hidden;padding:0px;margin:0px;';
sd2.innerHTML='<div id="Scroller:fx'+itmNum+'" style="position:relative;width:9999px;padding:0px;margin-left:0px;"><font size="3" color="red">Please wait while loading the table..</font></div>';
sd.parentNode.insertBefore(sd2,sd);
//alert("3333");
}
function fxheader()
{
if(flag) {return;}
flag=true;
var tbDiv=ge$(tid);
var twp=tbDiv.width;
var twi=parseInt(twp);
if(twp.indexOf("%") > 0)
{
twi=((ge$('Scroller:fx'+itmNum+':OuterDiv').offsetWidth * twi) / 100)-20;
twp=twi+'px';
tbDiv.style.width=twp;
}
var fh=ge$('Scroller:fx'+itmNum+'');
var cn=fh.childNodes;
for(var j=0;j<cn.length;j++)
{
fh.removeChild(cn[j]);
}
var t=tbDiv.cloneNode(false);
t.id=tid+'__cN';
t.style.width=tbDiv.offsetWidth+'px';
t.style.marginTop='0px';
var r=tbDiv.rows[0].cloneNode(true);
r.style.height=tbDiv.rows[0].offsetHeight+'px';
var th=document.createElement("thead");
th.appendChild(r);
t.appendChild(th);
fh.appendChild(t);
//adjusting widths
var c=ge$(tid+'__cN').rows[0].cells;
var oc=tbDiv.rows[0].cells;
for(var i=0;i<c.length;i++)
{
c[i].style.width=(oc[i].offsetWidth-3) + 'px';
}
ge$('Scroller:fx'+itmNum+':OuterDiv').style.height=oc[0].offsetHeight+'px';
tbDiv.style.marginTop = "-" + tbDiv.rows[0].offsetHeight + "px";
if(tbDiv.offsetHeight < sheight)
{
ge$(tid+':scroller').style.height=tbDiv.offsetHeight + 'px';
}
window.onresize=fxheader;
//alert("0000");
flag=false;
scrollHeader();
}
function fxheaderInit(_tid,_sheight)
{
//alert("-0000");
tid=_tid;
itmNum=_tid;
sheight=_sheight;
flag=false;
addScrollerDivs();
//alert("aaaaaaaa");
fxheader();
}
function form3Load()
{
var result = $("#mainContDiv").height();
fxheaderInit("Details",result-100);
}
//Changed by samadhan on 03/02/2015 for fixed matxix table header End
......@@ -27,7 +27,24 @@
<!-- Removed by Samadhan 19/11/2015 for delevary date calculation$( "#dlv_date1").datepicker({ minDate: 0, changeMonth: true, changeYear: true, dateFormat : "d/m/y"});-->
<!-- in above function pageLoad() function added by samadhan on 14/07/2015 -->
</script>
<!--//Changed by samadhan on 03/02/2015 for fixed matxix table header Start-->
<style type="text/css">
table.mt {border-width: 1px;border-spacing:0px ;border-style: solid;border-color: #cfcfcf;border-collapse: collapse;line-height: 25px;background-color: #FFF;}
table.mt th {border-width: 1px;padding: 1px;border-style: solid;border-color: #cfcfcf;white-space: normal;}
table.mt td {border-width: 1px;padding: 1px;border-style: solid;border-color: #cfcfcf;vertical-align:middle;white-space:nowrap;}
.tdClass>td{
padding: 0 10px;
border-right: 1px solid #eee;
border-right-color: rgba(0, 0, 0, 0.07);
font-family: Arial, Helvetica, Helvetica Neue, Verdana, sans-serif;
font-size: 12px;
text-shadow: 0 1px white;
text-shadow: 0 1px 1px rgba(0, 0, 0, .2);
text-rendering: optimizeLegib
}
</style>
<!--//Changed by samadhan on 03/02/2015 for fixed matxix table header End-->
<body>
<form name="porderWizFormII" id="porderWizFormII" METHOD="post" ACTION="/ibase/ITMWizardHandlerServlet">
<div class="mainPage-Container">
......@@ -150,7 +167,7 @@
Total Quantity<label id='display.1' style='background-color: transparent;'></label>
</h3>
<div style="padding: 0.8em 0.8em;">
<div id="suppDtlDiv1" style="height: 180px; overflow: auto; margin-left: 0px; width:100%;">
<div id="suppDtlDiv1" style="height: 270px; overflow: hidden; margin-left: 0px; width:100%;">
<table id="activityTable" border="0" style="text-align: center;">
<tr>
<td class="td_leftAlign" nowrap="true">
......
......@@ -18,8 +18,9 @@
<script language="JavaScript" type="text/javascript">
<![CDATA[
$(function()
{
{ form3Load();
var today = new Date();
var dd = today.getDate();
var mm = today.getMonth()+1;
......@@ -58,16 +59,34 @@
document.getElementById("save").style.display = ""; // to undisplay
document.getElementById("back").style.display = ""; // to undisplay
document.getElementById("buttonreplacement").style.display = "none"; // to display
]]>
</script>
<!--//Changed by samadhan on 03/02/2015 for fixed matxix table header Start-->
<style type="text/css">
table.mt {border-width: 1px;border-spacing:0px ;border-style: solid;border-color: #cfcfcf;border-collapse: collapse;line-height: 25px;background-color: #FFF;}
table.mt th {border-width: 1px;padding: 1px;border-style: solid;border-color: #cfcfcf;white-space: normal;text-rendering: optimizeLegibility;white-space:nowrap;}
table.mt td {border-width: 1px;padding: 1px;border-style: solid;border-color: #cfcfcf;vertical-align:middle;white-space:nowrap;}
.tdClass>td{
padding: 0 10px;
border-right: 1px solid #eee;
border-right-color: rgba(0, 0, 0, 0.07);
font-family: Arial, Helvetica, Helvetica Neue, Verdana, sans-serif;
font-size: 12px;
text-shadow: 0 1px white;
text-shadow: 0 1px 1px rgba(0, 0, 0, .2);
text-rendering: optimizeLegib
}
</style>
<!--//Changed by samadhan on 03/02/2015 for fixed matxix table header End-->
<body>
<form name="porderWizFormIII" id="porderFormIII" METHOD="post" ACTION="/ibase/ITMWizardHandlerServlet">
<!-- <div id="header" style="width:100%;height:100px">
<div id="headingText">Purchase Wizard Details</div>
</div>-->
<div class="mainPage-Container" style="height:99%;width:99%;overflow:scroll;">
<div id='mainContDiv' class="mainPage-Container" style="height:99%;width:99%;overflow:hidden;" >
<!-- Changed by samadhan on 13/07/2015 for previous button working Start -->
<div style="width: 99%; margin-top: 5px;">
<xsl:for-each select="//Detail3">
......@@ -150,53 +169,53 @@
</div>
<!-- Changed by samadhan on 13/07/2015 for previous button working End -->
<table class="tableClass" id="Details" border="0" cellspacing="1" cellpadding="1">
<thead class="table-head" style="text-align:center;position:relative">
<tr>
<table class="mt" id="Details" border="0" cellspacing="1" cellpadding="1">
<thead class="table-head" style="text-align:center;position:relative; line-height: 25px;">
<tr class="thClass" >
<th class="thClass" nowrap="true" style="width:20px">
</th>
<th class="thClass" nowrap="true" valign="bottom" style="font-size:12px">
<th class="thClass" nowrap="true" >
<strong>Item Parent</strong>
</th>
<th class="thClass" nowrap="true" valign="bottom" style="font-size:12px">
<th class="thClass" nowrap="true" width="70px">
<strong>Item SKU Code</strong>
</th>
<th class="thClass" nowrap="true" valign="bottom" style="font-size:12px">
<th class="thClass" nowrap="true" >
<strong>Description</strong>
</th>
<th class="thClass" nowrap="true" valign="bottom" style="font-size:12px">
<th class="thClass" nowrap="true" >
<strong>Quantity</strong>
</th>
<th class="thClass" nowrap="true" valign="bottom" style="font-size:12px">
<th class="thClass" nowrap="true" >
<strong>Unit Cost</strong>
</th>
<!--Changed by wasim on 07-07-2015 to add currency in form3 [START]-->
<th class="thClass" nowrap="true" valign="bottom" style="font-size:12px">
<th class="thClass" nowrap="true" >
<strong>Currency</strong>
</th>
<!--Changed by wasim on 07-07-2015 to add currency in form3 [END]-->
<th class="thClass" nowrap="true" valign="bottom" style="font-size:12px">
<th class="thClass" nowrap="true" >
<strong>Amount</strong>
</th>
<th class="thClass" nowrap="true" valign="bottom" style="font-size:12px">
<th class="thClass" nowrap="true" >
<strong>Order Date</strong>
</th>
<th class="thClass" nowrap="true" valign="bottom" style="font-size:12px">
<th class="thClass" nowrap="true" >
<strong>Delivery Date</strong>
</th>
<th class="thClass" nowrap="true" valign="bottom" style="font-size:12px">
<th class="thClass" nowrap="true" >
<strong>Supplier Code</strong>
</th>
<th class="thClass" nowrap="true" valign="bottom" style="font-size:12px">
<th class="thClass" nowrap="true" >
<strong>Tax Class</strong>
</th>
<th class="thClass" nowrap="true" valign="bottom" style="font-size:12px">
<th class="thClass" nowrap="true" >
<strong>Tax Chap</strong>
</th>
<th class="thClass" nowrap="true" valign="bottom" style="font-size:12px">
<strong>Tax Env</strong>
<th class="thClass" nowrap="true" >
Tax Env
</th>
......@@ -255,7 +274,7 @@
<!-- Changed by samadhan on 13/07/2015 for previous button working -->
<xsl:if test="$dbID != '0'">
<tr style="text-align:center">
<tr class="tdClass" style="text-align:center">
<!--<td style="width:20px">
<input type="checkbox" name="Detail3.{normalize-space($dbID)}.selectbox" id="Detail3.{normalize-space($dbID)}.selectbox" checked='true' value="true" onClick="setChecked(this)"/>
</td>-->
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment