advice on TTIWAdvWebGrid

Hi all

I'm try to do the following page:
 
1. i put one TTIWAdvWebGrid on the page.
 
Column0 (visible false) containd ID's from database.
Column1 - hold a value from the database (user cannot modify) ctNormal
Column 2,3 - user imput (columnType ctDynEdit, dyneditor = deFloatSigned).
Column 4 is the summary
type = ctDynText
footer type = ftDynSum
formula = C1C2+C1C3
 
all is good so far
however i need also the following
on the last row a permition to a user to imput an "OFFSET AMOUNT" and also to be taking into computation on the colum4 total.
on event gridTableGetCellType i made the following
procedure TfrmTableCountCloseModify.gridTableGetCellType(Sender: TObject; RowIndex, ColumnIndex: Integer; var AColumnType: TTIWColumnType; var Editor: TTIWColumnEditor; var DynEditor: TTIWDynEditType);
begin
  inherited;
  if ((RowIndex = mOffsetIndex) and (ColumnIndex in [2, 3])) then begin
    AColumnType := ctNormal;
  end;
  if (ColumnIndex = 4) then begin
    AColumnType := ctDynText;
  end;
  if ((RowIndex = mOffsetIndex) and (ColumnIndex = 4)) then begin
    AColumnType := ctDynEdit;
  end;
end;
 
result is ... the page FROZE
can anyone help me .. any advice.
 
http://www.freeimagehosting.net/3k5j3
tks alot

A page that freezes usually indicates that a JavaScript error has occurred.
Can you please provide the error description that your browser provides when the error occurs?

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; BOIE8;ENUSMSCOM; AskTbFXTV5/5.8.0.12304)
Timestamp: Mon, 16 Apr 2012 17:22:29 UTC


Message: Unknown runtime error
Line: 792
Char: 1
Code: 0
URI: http://127.0.0.1:8001/$/js/TMSGRID.js_11.0.58


dm=document.getElementById?1:0;op=(window.opera&&dm)?1:0;ie=(document.all&&!op)?1:0;ns=(dm&&!ie&&!op)?1:0;isIE=navigator.appName.indexOf("Microsoft")!=-1;var shiftTab=false;var wgw1;var wgw2;var sbw=-1;var ffarrowkeydown=false;var ffgridclick=false;function gridDrawShape(el,fill,size){var canvas=document.getElementById(el);if(canvas.getContext){var ctx=canvas.getContext("2d");ctx.beginPath();ctx.moveTo(0,0);ctx.lineTo(size,0);ctx.lineTo(size,size);ctx.fillStyle=fill;ctx.fill();}};function getScrollBarWidth(){var inner=document.createElement('p');inner.style.width='100%';inner.style.height='200px';var outer=document.createElement('div');outer.style.position='absolute';outer.style.top='0px';outer.style.left='0px';outer.style.visibility='hidden';outer.style.width='200px';outer.style.height='150px';outer.style.overflow='hidden';outer.appendChild(inner);document.body.appendChild(outer);var w1=inner.offsetWidth;outer.style.overflow='scroll';var w2=inner.offsetWidth;if(w1==w2)
w2=outer.clientWidth;document.body.removeChild(outer);return(w1-w2);};function GASetRowOffset(obj,offset,chkrow,pageoffset)
{obj.rowoffset=offset;obj.checkrow=chkrow;tempoffset=obj.pageoffset;obj.pageoffset=pageoffset;DoScrollIntoView(obj);obj.pageoffset=tempoffset;}
function GASetEditRow(obj)
{obj.editrow=-1;}
function GAColClick(obj,index,iwclname,ajax)
{if(ajax)
{for(c=0;c<obj.ccount;c++)
{var sind=document.getElementById(obj.id+"SIND"+c);if(sind)
{if(c==index)
{var sindasc=document.getElementById(obj.id+"SINDASC");if(sindasc)
{if(sind.innerHTML==sindasc.innerHTML)
sind.innerHTML=document.getElementById(obj.id+"SINDDESC").innerHTML;else
sind.innerHTML=sindasc.innerHTML;}
else
{var sindcheck=document.getElementById(obj.id+"SINDCHECK"+c);if(sindcheck.innerHTML=="DESC")
{sindcheck.innerHTML="ASC";sind.innerHTML="&#9660;";}
else
{sindcheck.innerHTML="DESC";sind.innerHTML="&#9650;";}}
sind.style.display="";}
else
sind.style.display="none";}}
tempval=document.getElementById(obj.id+"_INPUT").value;document.getElementById(obj.id+"_INPUT").value+="|chclick"+index;processAjaxEvent('onColumnHeaderClick',iwclname,''+obj.id+'.DoAsyncColumnHeaderClick',true,null,true);processAjaxEvent('onSortClick',iwclname,''+obj.id+'.DoAsyncSortClick',true,null,true);document.getElementById(obj.id+"_INPUT").value=tempval;}
else
{return SubmitClick(obj.id,"ColClick"+index);}}
function GASGoto(obj,index,iwclname,ajax)
{if(ajax)
{tempval=document.getElementById(obj.id+"_INPUT").value;document.getElementById(obj.id+"_INPUT").value+="|gotop"+index;processAjaxEvent('onGotoPage',iwclname,''+obj.id+'.DoAsyncGotoPage',true,null,true);document.getElementById(obj.id+"_INPUT").value=tempval;}
else
{return SubmitClick(obj.id,"Goto"+index);}}
function GASetCtrl(obj,values)
{var ctrlt=document.getElementById(obj.id+"CTRLT");var ctrlb=document.getElementById(obj.id+"CTRLB");if(ctrlt)
ctrlt.innerHTML=values;if(ctrlb)
ctrlb.innerHTML=values;}
function GASetCellState(obj,cellstates,singlerow,c)
{elem=FindElem(obj.id);submval=elem.value;s_ar=submval.split("|");s_ar[0]=cellstates;elem.value=s_ar.join("|");for(var i=1;i<=obj.rcount;i++)
{if(singlerow)
obj.cellstate[i-1]="0";el=document.getElementById(obj.fids+"CK"+c+"R"+(i-1));if(cellstates.substring(i-1,i)=="0")
{if(el)
{el.checked=false;}
GARowClick(obj,i,false);}
else
{if(el)
{el.checked=true;}
GARowClick(obj,i,true);}}}
function GASetCell(obj,values)
{var sval=values.split("~");for(i=1;i<sval.length;i++)
{var cellval=sval[i-1].split("|");var r=parseInt(cellval[1]);var c=parseInt(cellval[0]);var val=cellval[2];var colval=document.getElementById("CV"+obj.fids+"R"+r+"C"+c);if(colval)
{if(val=="&nbsp;")
colval.innerHTML="";else
colval.innerHTML=val;}
if((obj.coltype[c]!="DataButton")&&(obj.coltype[c]!="Button")&&(obj.coltype[c]!="ImageCheckBox")&&(obj.coltype[c]!="DynCheckBox")&&(obj.coltype[c]!="DynEdit")&&(obj.coltype[c]!="DynText")&&(obj.coltype[c]!="DynMemo")&&(obj.coltype[c]!="DynCombo"))
{if(obj.coltype[c]=="Password")
{var el=document.getElementById(obj.fids+"D"+r+"C"+c);if(el)
{pwd="";for(j=0;j<val.length;j++)
pwd+="";el.innerHTML=pwd;}}
else if(obj.coltype[c]=="CheckBox")
{var el=document.getElementById(obj.fids+"CK"+c+"R"+r);if(el)
{if(val=="-1")
el.checked=true;else
el.checked=false;}}
else if(obj.coltype[c]=="RadioButton")
{var el=document.getElementById(obj.fids+"RADC"+c+"R"+r);if(el)
{if(val=="-1")
el.checked=true;else
el.checked=false;}}
else if(obj.coltype[c]=="LinkRowNumber")
{var el=document.getElementById(obj.fids+"D"+r+"C"+c);if(el)
el.innerHTML=val;}
else if(obj.coltype[c]=="RowIndicator")
{var el=document.getElementById(obj.fids+"c"+(c+1)+"r"+(r+1));if(el)
el.innerHTML=val;}
else if((obj.coltype[c]=="Image")||(obj.coltype[c]=="DataImage"))
{if(val!="#cached#")
{var el=document.getElementById(obj.fids+"c"+(c+1)+"r"+(r+1));if(el)
{if(val.toLowerCase().indexOf("<img")>=0)
el.innerHTML=val;else
el.innerHTML="&nbsp;";}}}
else if(obj.coltype[c]=="DataImageCheckBox")
{var el=document.getElementById(obj.fids+"D"+r+"C"+c);if(el)
{if(val.toLowerCase()==obj.colchecktrue[c].toLowerCase())
el.innerHTML=document.getElementById(obj.fids+"TD"+r+"C"+c).innerHTML;else
el.innerHTML=document.getElementById(obj.fids+"FD"+r+"C"+c).innerHTML;}}
else if(obj.coltype[c]=="DataCheckBox")
{var el=document.getElementById(obj.fids+"D"+r+"C"+c);if(el)
{if(val.toLowerCase()==obj.colchecktrue[c].toLowerCase())
el.checked=true;else
el.checked=false;}}
else if(obj.coltype[c]=="Popup")
{var el=document.getElementById(obj.fids+"pd"+(r+1)+"c"+(c+1));if(el)
el.innerHTML=val;var el=document.getElementById(obj.fids+"pdt"+(r+1)+"c"+(c+1));if(el)
el.innerHTML=val;}
else if(obj.coltype[c]=="Progress")
{el.innerHTML="&nbsp;"+val+"%";if(parseInt(val))
{if(parseInt(val)>100)
val=100;if(parseInt(val)<0)
val=0;el.style.width=val+"%";}}
else
{var el=document.getElementById(obj.fids+"D"+r+"C"+c);if(el)
el.innerHTML=val;}
if(obj.coltype[c]=="URL")
{if(val.toLowerCase().indexOf("=0'>http://")>=0)
el.href=val;else
el.href="http://"+val;}
if(obj.coltype[c]=="Email")
el.href="mailto:"+val;}}}
function GASetRows(obj,visiblerows)
{for(j=1;j<=obj.rcount;j++)
{if(j>visiblerows)
{el=document.getElementById(obj.fids+"row"+j);if(el)
el.style.display="none";}
else
{el=document.getElementById(obj.fids+"row"+j);if(el)
el.style.display="";}}}
function GASetDB(obj,r)
{for(j=0;j<obj.rcount;j++)
{el=document.getElementById(obj.fids+"DBE"+j);if(el)
el.style.display="";if(j==r)
{el=document.getElementById(obj.fids+"DBP"+j);if(el)
el.style.display="none";el=document.getElementById(obj.fids+"DBC"+j)
if(el)
el.style.display="none";}}}
function GAPostValidate(obj,msg)
{if(msg!="")
{alert(msg);}}
function GAPost(value,obj,r)
{if(obj.editrow!=-1)
r=obj.editrow;var colval=value.split("|");for(i=0;i<obj.ccount;i++)
{if(obj.coltype=="DataButton")
{GASetDB(obj,r);}
else if((obj.coledit!="None")&&(obj.coltype!="DynCheckBox")&&(obj.coltype!="DynEdit")&&(obj.coltype!="DynText")&&(obj.coltype!="DynMemo")&&(obj.coltype!="DynCombo"))
{el=document.getElementById(obj.fids+"D"+r+"C"+i);if(el)
{el.style.display=""
document.getElementById("CV"+obj.fids+"R"+r+"C"+i).innerHTML=colval[i+4];if(obj.coltype=="DataImageCheckBox")
{if(colval[i+4].toLowerCase()=="true")
el.innerHTML=document.getElementById(obj.fids+"TD"+r+"C"+i).innerHTML;else
el.innerHTML=document.getElementById(obj.fids+"FD"+r+"C"+i).innerHTML;}
else if(obj.coltype=="DataCheckBox")
{if(colval[i+4].toLowerCase()=="true")
el.checked=true;else
el.checked=false;}
else if(obj.coledit=="CheckBox")
{if(colval[i+4].toLowerCase()=="true")
el.innerHTML=obj.colchecktrue;else
el.innerHTML=obj.colcheckfalse;document.getElementById("CV"+obj.fids+"R"+r+"C"+i).innerHTML=el.innerHTML;}
else if(obj.coledit=="RadioButton")
{if(colval[i+4].toLowerCase()=="true")
el.innerHTML=obj.colchecktrue;else
el.innerHTML=obj.colcheckfalse;document.getElementById("CV"+obj.fids+"R"+r+"C"+i).innerHTML=el.innerHTML;}
else if(obj.coltype=="Popup")
{el=document.getElementById(obj.fids+"pd"+(r+1)+"c"+(i+1));el.innerHTML=colval[i+4];el=document.getElementById(obj.fids+"pdt"+(r+1)+"c"+(i+1));el.innerHTML=colval[i+4];}
else if(obj.coltype=="Progress")
{el.innerHTML="&nbsp;"+colval[i+4]+"%";if(parseInt(colval[i+4]))
el.style.width=(parseInt(colval[i+4])/100
128)+"px";}
else
el.innerHTML=colval[i+4];if(obj.coltype=="URL")
{if(colval[i+4].toLowerCase().indexOf("=0'>http://")>=0)
el.href=colval[i+4];else
el.href="http://"+colval[i+4</a>];}
if(obj.coltype=="Email")
el.href="
mailto:"+colval[i+4];document.getElementById("HE"+obj.fids+"R"+r+"C"+i).style.display="none";}}}}
function GACancel(obj,r)
{FindElem(obj.id).value=obj.origval;obj.origval="";for(i=0;i<obj.ccount;i++)
{if(obj.coltype=="DataButton")
{GASetDB(obj,r);}
else
{if(obj.coledit!="None")
{el=document.getElementById(obj.fids+"D"+r+"C"+i)
if(el)
el.style.display="";el=document.getElementById("HE"+obj.fids+"R"+r+"C"+i);if(el)
el.style.display="none";}}}}
function GAEdit(obj,r,iwclname,doajax)
{var value=FindElem(obj.id).value;obj.origval=value;obj.editrow=r;for(c=0;c<obj.ccount;c++)
{if(obj.coltype[c]=="DataButton")
{for(j=0;j<obj.rcount;j++)
{el=document.getElementById(obj.fids+"DBE"+j);if(el)
el.style.display="none";if(j==r)
{el=document.getElementById(obj.fids+"DBP"+j);if(el)
el.style.display="";el=document.getElementById(obj.fids+"DBC"+j);if(el)
el.style.display="";}}}
else if(obj.coledit[c]!="None")
{var colval=document.getElementById("CV"+obj.fids+"R"+r+"C"+c).innerHTML
if(colval=="&nbsp;")
{colval="";}
submval=FindElem(obj.id).value;s_ar=submval.split("|");s_ar[c+4]=colval.replace(/\/g,"\");FindElem(obj.id).value=s_ar.join("|");sn=obj.fids+"D"+r+"C"+c;el=document.getElementById(sn);if(el!=null)
{sne="HE"+obj.fids+"R"+r+"C"+c;he=document.getElementById(sne);if(he!=null)
{editor=document.getElementById(obj.fids+"AER"+r+"C"+c);if(obj.coledit[c]=="CheckBox")
{if(colval.toLowerCase()==obj.colchecktrue[c].toLowerCase())
editor.checked=true;else
editor.checked=false;}
else if(obj.coledit[c]=="Popup")
{editor.innerHTML=colval;}
else
editor.value=colval;he.style.display="";}
el.style.display="none";}}}
if(doajax)
{tempval=document.getElementById(obj.id+"_INPUT").value;document.getElementById(obj.id+"_INPUT").value+="|editrow"+r;processAjaxEvent('onEdit',iwclname,''+obj.id+'.DoAsyncEdit',true,null,true);document.getElementById(obj.id+"_INPUT").value=tempval;}}
function cellkey(obj,event)
{if((key==9)&&(event.shiftKey))
{shiftTab=true;}}
function gridClick(obj)
{if((!isIE)&&(ffgridclick==false))
{gd=document.getElementById(obj.id+"hi");if(gd)
gd.focus();}
ffgridclick=false;}
function tablekey(obj,event,iwclname)
{key=(isIE)?event.keyCode:event.which;if(obj.seledit!="")
return;var c=-1;var r=-1;c=obj.selcol;r=obj.selrow;obj.clientgridkeydown(obj,c,r,event);if((key==33)&&(obj.curpage>0)){newpage=obj.curpage-1;event.returnValue=false;return SubmitClick(obj.id,"Goto"+newpage);}
if((key==34)&&(obj.curpage<obj.maxpages-1)){newpage=obj.curpage+1;event.returnValue=false;return SubmitClick(obj.id,"Goto"+newpage);}
if(obj.mouseselect=="msEdit"){if((key==9)&&(event.shiftKey)){shiftTab=true;}
if(key==40){if(!ffarrowkeydown)
{newrow=obj.selrow+1;event.returnValue=false;if((newrow<=obj.rcount)&&(newrow>0))
cellclick(obj,newrow,obj.selcol,iwclname);}
ffarrowkeydown=false;}
else if(key==38){if(!ffarrowkeydown)
{newrow=obj.selrow-1;event.returnValue=false;if(newrow>0)
cellclick(obj,newrow,obj.selcol,iwclname);}
ffarrowkeydown=false;}
else if(key==37){newcol=obj.selcol-1;event.returnValue=false;if(newcol>0)
cellclick(obj,obj.selrow,newcol,iwclname);}
else if(key==39){newcol=obj.selcol+1;event.returnValue=false;if((newcol<=obj.ccount)&&(newcol>0))
cellclick(obj,obj.selrow,newcol,iwclname);}
else if(key==113){editclick(obj,obj.selcol-1,obj.selrow-1,-1,false);}
else{editclick(obj,obj.selcol-1,obj.selrow-1,0,false);}}}
function find(obj)
{s=prompt("Search for text","");flg=false;if(s==null)return;for(i=0;i<obj.ccount;i++)
for(j=0;j<obj.rcount;j++){cid=obj.fids+"D"+j+"C"+i;el=document.getElementById(cid);if(el!=null){if(el.innerHTML.toLowerCase().indexOf(s.toLowerCase())>=0)
{cellhilight(obj,j+1,i+1);flg=true;if(window.confirm("Text found. Continue search ?")==false)return;}}}
if(flg==false)alert("No matching text found");}
function RadioClick(obj,chk,r,numc,c)
{submval=FindElem(obj.id).value;s_ar=submval.split("|");s_ar[1]="R"+r;FindElem(obj.id).value=s_ar.join("|");}
function RowAllClick(obj,chk,r,numc,c)
{for(i=1;i<=numc;i++)
{s=obj.fids+"c"+i+"r"+r;if(chk.checked)
{el=document.getElementById(s);if(obj.showselect){el.style.backgroundColor=obj.selectcolor;el.style.color=obj.selectfontcolor;}
obj.cellstate[r-1]="1";}
else
{obj.cellstate[r-1]="0";if(obj.showselect)
{el=document.getElementById(s);if(obj.bands)
{if(r%2==1)
el.style.backgroundColor=obj.scol;else
el.style.backgroundColor=obj.pcol;}
else
{el.style.backgroundColor=obj.columncolors[i-1];}
el.style.color=obj.fontcolor;}}}}
function CheckAll(obj,ctrl,c,iwclname)
{if(obj.rowsonpage>0)
{for(ci=0;ci<obj.rowsonpage;ci++)
{s=obj.fids+"CK"+c+"R"+ci;if(document.getElementById(s)==null)
s=obj.fids+"D"+c+"C"+ci;if(document.getElementById(s)!=null)
document.getElementById(s).checked=ctrl.checked;RowAllClick(obj,ctrl,ci+1,obj.ccount,c);}
for(i=1;i<=obj.cellstate.length;i++)
{if(i>1)
s=s+obj.cellstate[i-1];else
s=obj.cellstate[i-1];}
submval=FindElem(obj.id).value;s_ar=submval.split("|");s_ar[0]=s;FindElem(obj.id).value=s_ar.join("|");var r=-1;if(obj.onasynccheckclick)
{tempval=document.getElementById(obj.id+"_INPUT").value;document.getElementById(obj.id+"_INPUT").value+="|cellr"+r+"|cellc"+c;processAjaxEvent('onCheckClick',iwclname,''+obj.id+'.DoAsyncCheckClick',true,null,true);document.getElementById(obj.id+"_INPUT").value=tempval;}
else if(obj.oncheckclick)
return SubmitClick(obj.id,"CheckClick"+r+":"+c);}}
function GARowClick(obj,row,checked)
{for(j=1;j<=obj.ccount;j++)
{s=obj.fids+"c"+j+"r"+row;if(checked)
{obj.cellstate[row-1]="1";if(obj.showselect)
{el=document.getElementById(s);if(el)
{el.style.backgroundColor=obj.selectcolor;if(el.firstChild)
{if(el.firstChild.tagName=="FONT")
el.firstChild.style.color=obj.selectfontcolor;}
el.style.color=obj.selectfontcolor;}}}
else
{var CHALL=document.getElementById(obj.id+"CHALL"+(j-1));if(CHALL)
CHALL.checked=false;obj.cellstate[row-1]="0";if(obj.showselect)
{el=document.getElementById(s);if(el)
{if(obj.bands)
{if(row%2==1)
el.style.backgroundColor=obj.scol;else
el.style.backgroundColor=obj.pcol;}
else
{if((obj.pageoffset==(row-1))&&(obj.activerowcolor!=""))
el.style.backgroundColor=obj.activerowcolor;else
el.style.backgroundColor=obj.columncolors[j-1];}
if((obj.pageoffset==(row-1))&&(obj.activerowfontcolor!=""))
{if(el.firstChild)
{if(el.firstChild.tagName=="FONT")
el.firstChild.style.color=obj.activerowfontcolor;}}
else
{el.style.color=obj.fontcolor;if(el.firstChild)
{if(el.firstChild.tagName=="FONT")
el.firstChild.style.color=obj.fontcolor;}}}}}}}
function RowClick(obj,chk,r,numc,c,subm,iwclname)
{obj.clientcheckclick(obj,c,r);for(i=1;i<=numc;i++)
{s=obj.fids+"c"+i+"r"+r;if(chk.checked)
{el=document.getElementById(s);if(obj.showselect)
{el.style.backgroundColor=obj.selectcolor;if(obj.coltype=="Popup")
document.getElementById(obj.fids+"pdt"+r+"c"+(i+1)).style.color=obj.selectfontcolor;else if(el.firstChild)
{if(el.firstChild.tagName=="FONT")
el.firstChild.style.color=obj.selectfontcolor;}
el.style.color=obj.selectfontcolor;}
obj.cellstate[r-1]="1";}
else
{if(document.getElementById(obj.id+"CHALL"+c))
document.getElementById(obj.id+"CHALL"+c).checked=false;obj.cellstate[r-1]="0";if(obj.showselect)
{el=document.getElementById(s);if(obj.bands)
{if(r%2==1)
el.style.backgroundColor=obj.scol;else
el.style.backgroundColor=obj.pcol;}
else
{if((obj.pageoffset==(r-1))&&(obj.activerowcolor!=""))
el.style.backgroundColor=obj.activerowcolor;else
el.style.backgroundColor=obj.columncolors[i-1];}
if((obj.pageoffset==(r-1))&&(obj.activerowfontcolor!=""))
{el.style.color=obj.activerowfontcolor;if(obj.coltype=="Popup")
document.getElementById(obj.fids+"pdt"+r+"c"+(i+1)).style.color=obj.activerowfontcolor;else if(el.firstChild)
{if(el.firstChild.tagName=="FONT")
el.firstChild.style.color=obj.activerowfontcolor;}}
else
{el.style.color=obj.fontcolor;if(obj.coltype=="Popup")
document.getElementById(obj.fids+"pdt"+r+"c"+(i+1)).style.color=obj.fontcolor;else if(el.firstChild)
{if(el.firstChild.tagName=="FONT")
el.firstChild.style.color=obj.fontcolor;}}}}}
for(i=1;i<=obj.cellstate.length;i++)
{if(i>1)
s=""+s+obj.cellstate[i-1];else
s=""+obj.cellstate[i-1];}
submval=FindElem(obj.id).value;s_ar=submval.split("|");s_ar[0]=s;FindElem(obj.id).value=s_ar.join("|");if(obj.onasyncrowselect)
{tempval=document.getElementById(obj.id+"_INPUT").value;document.getElementById(obj.id+"_INPUT").value+="|rselr"+(r-1)+"|rselc"+chk.checked;processAjaxEvent('onRowSelect',iwclname,''+obj.id+'.DoAsyncRowSelect',true,null,true);document.getElementById(obj.id+"_INPUT").value=tempval;}
if(obj.onasynccheckclick)
{tempval=document.getElementById(obj.id+"_INPUT").value;document.getElementById(obj.id+"_INPUT").value+="|cellr"+(r-1)+"|cellc"+(c-1);processAjaxEvent('onCheckClick',iwclname,''+obj.id+'.DoAsyncCheckClick',true,null,true);document.getElementById(obj.id+"_INPUT").value=tempval;}
else if(obj.oncheckclick)
if(subm)return SubmitClick(obj.id,"CheckClick"+(r-1)+":"+(c-1));}
function GARowChange(obj,r)
{prevr=-1;for(j=1;j<=obj.rcount;j++)
{if(obj.cellstate[j-1]!="1")
{if(obj.pageoffset==(j-1))
prevr=(j-1);}}
obj.pageoffset=r;for(i=0;i<=obj.ccount;i++)
{s=obj.fids+"c"+i+"r"+(r+1);sd=obj.fids+"D"+r+"C"+i;sp=obj.fids+"c"+i+"r"+(prevr+1);spd=obj.fids+"D"+prevr+"C"+i;if(obj.activerowcolor!="")
{if((r+1)!=(prevr+1))
{el=document.getElementById(sp);if(el)
{if(obj.bands)
{if((prevr+1)%2==1)
el.style.backgroundColor=obj.scol;else
el.style.backgroundColor=obj.pcol;}
else
el.style.backgroundColor=obj.columncolors[i-1];}}
el=document.getElementById(s);if(el)
el.style.backgroundColor=obj.activerowcolor;}
if(obj.activerowfontcolor!="")
{if((r+1)!=(prevr+1))
{el=document.getElementById(spd)
if(el)
{if(obj.coltype!="Button")
el.style.color=obj.coltextcolors;if(el.parentElement)
{if(el.parentElement.tagName=="FONT")
el.parentElement.color=obj.coltextcolors;}
else if(el.parentNode)
{if(el.parentNode.tagName=="FONT")
el.parentNode.color=obj.coltextcolors;}}
el=document.getElementById(sp)
if(el)
{if(obj.coltype!="Button")
el.style.color=obj.coltextcolors;if(el.firstChild)
{if(el.firstChild.tagName=="FONT")
el.firstChild.style.color=obj.coltextcolors;}
if(obj.coltype=="Popup")
document.getElementById(obj.fids+"pdt"+(prevr+1)+"c"+(i+1)).style.color=obj.coltextcolors;}}
el=document.getElementById(sd);if(el)
{if(obj.coltype!="Button")
el.style.color=obj.activerowfontcolor;if(el.firstChild)
{if(el.firstChild.tagName=="FONT")
el.firstChild.style.color=obj.activerowfontcolor;}
if(obj.coltype=="Popup")
document.getElementById(obj.fids+"pdt"+(r+1)+"c"+(i+1)).style.color=obj.activerowfontcolor;}
else
{el=document.getElementById(s);if(el)
{if(obj.coltype!="Button")
el.style.color=obj.activerowfontcolor;if(el.firstChild)
{if(el.firstChild.tagName=="FONT")
el.firstChild.style.color=obj.activerowfontcolor;}
if(obj.coltype=="Popup")
document.getElementById(obj.fids+"pdt"+(r+1)+"c"+(i+1)).style.color=obj.activerowfontcolor;}}}}}
function RowMove(obj,c,r,iwclname)
{if(obj.onasyncactiverowmove)
{tempval=document.getElementById(obj.id+"_INPUT").value;document.getElementById(obj.id+"_INPUT").value+="|gotor"+r;processAjaxEvent('onGotoRow',iwclname,''+obj.id+'.DoAsyncGotoRow',true,null,true);document.getElementById(obj.id+"_INPUT").value=tempval;}
else
return SubmitClick(obj.id,"Move"+r+":"+c);}
function RowCheck(obj,r,iwclname,v,single)
{var chkchecked=true;if((obj.checkrow!=-1)&&(v==1))
{RowCheck(obj,obj.checkrow,iwclname,0,true);}
if(single)
curstate=false;else
curstate=(obj.cellstate[r-1]=="0");if(v==1)
{if(curstate)
obj.checkrow=r;else
obj.checkrow=-1;}
for(i=1;i<=obj.ccount;i++)
{s=obj.fids+"c"+i+"r"+r;if(curstate)
{if(obj.showselect)
{el=document.getElementById(s);el.style.backgroundColor=obj.selectcolor;el.style.color=obj.selectfontcolor;}
obj.cellstate[r-1]="1";chkchecked=true;}
else
{obj.cellstate[r-1]="0";chkchecked=false;if(obj.showselect)
{el=document.getElementById(s);if(obj.bands)
{if(r%2==1)
el.style.backgroundColor=obj.scol;else
el.style.backgroundColor=obj.pcol;}
else
{el.style.backgroundColor=obj.columncolors[i-1];}
el.style.color=obj.fontcolor;}}}
for(i=1;i<=obj.cellstate.length;i++)
{if(i>1)
s=s+obj.cellstate[i-1];else
s=obj.cellstate[i-1];}
submval=FindElem(obj.id).value;s_ar=submval.split("|");s_ar[0]=s;FindElem(obj.id).value=s_ar.join("|");RadioClick(obj,"",r,"","")
if((obj.onasyncrowselect)&&(single==false))
{tempval=document.getElementById(obj.id+"_INPUT").value;document.getElementById(obj.id+"_INPUT").value+="|rselr"+(r-1)+"|rselc"+chkchecked;processAjaxEvent('onRowSelect',iwclname,''+obj.id+'.DoAsyncRowSelect',true,null,true);document.getElementById(obj.id+"_INPUT").value=tempval;}}
function FilterChange(obj,ctrl,c)
{return SubmitClick(obj.id,"Filter"+c+":"+ctrl.value)}
function RowCountChange(obj,ctrl)
{return SubmitClick(obj.id,"RowCount"+ctrl.value)}
function SelectPage(obj,ctrl,iwclname,ajax)
{var selpage=ctrl.value-1;GASGoto(obj,selpage,iwclname,ajax);}
function SyncScroll(obj,ctrl)
{if(obj.showrowheader)
document.getElementById(obj.id+'div2').scrollTop=ctrl.scrollTop;if(obj.showcolheader)
document.getElementById(obj.id+'div3').scrollLeft=ctrl.scrollLeft;if(obj.showfooter)
document.getElementById(obj.id+'div4').scrollLeft=ctrl.scrollLeft;submval=FindElem(obj.id).value;s_ar=submval.split("|");s_ar[2]=ctrl.scrollTop+"^"+ctrl.scrollLeft;submval=s_ar.join("|");FindElem(obj.id).value=submval;}
function LnkClick(obj,c,r,iwclname)
{r=parseInt(r)+parseInt(obj.rowoffset);if(obj.onasynclinkclick)
{tempval=document.getElementById(obj.id+"_INPUT").value;document.getElementById(obj.id+"_INPUT").value+="|cellr"+r+"|cellc"+c;processAjaxEvent('onLinkClick',iwclname,''+obj.id+'.DoAsyncLinkClick',true,null,true);document.getElementById(obj.id+"_INPUT").value=tempval;}
else if(obj.onlinkclick)
return SubmitClick(obj.id,"LnkClick"+r+':'+c)}
function ImgClick(obj,c,r,s,iwclname)
{obj.clientimageclick(obj,c,r,s);if(s!="")
if(confirm(s)==false)return;if(obj.onasyncimageclick)
{tempval=document.getElementById(obj.id+"_INPUT").value;document.getElementById(obj.id+"_INPUT").value+="|cellr"+r+"|cellc"+c;processAjaxEvent('onImageClick',iwclname,''+obj.id+'.DoAsyncImageClick',true,null,true);document.getElementById(obj.id+"_INPUT").value=tempval;}
else if(obj.onimageclick)
return SubmitClick(obj.id,"ImgClick"+r+":"+c)}
function BtnClick(obj,c,r,s,iwclname)
{r=parseInt(r)+parseInt(obj.rowoffset);obj.clientbuttonclick(obj,c,r,s);if(s!="")
if(confirm(s)==false)return;if(obj.onasyncbuttonclick)
{tempval=document.getElementById(obj.id+"_INPUT").value;document.getElementById(obj.id+"_INPUT").value+="|cellr"+r+"|cellc"+c;processAjaxEvent('onButtonClick',iwclname,''+obj.id+'.DoAsyncButtonClick',true,null,true);document.getElementById(obj.id+"_INPUT").value=tempval;}
else if(obj.onbuttonclick)
return SubmitClick(obj.id,"BtnClick"+r+":"+c);}
function AsyncUpdate(obj)
{if(!containsName(obj.id)){window.ChangedControls+=obj.id+",";}}
var valeditctrl=null;function GAValidate(obj,c,r,value,msg)
{if(valeditctrl)
{if(obj.coledit[c]=="CheckBox")
{if(value.toLowerCase()==obj.colchecktrue[c].toLowerCase())
valeditctrl.checked=true;else
valeditctrl.checked=false;}
else if(obj.coledit[c]=="Popup")
{document.getElementById(obj.fids+'AER'+r+'C'+c).innerHTML=value;document.getElementById(obj.fids+'TA'+r+'c'+c).value=value;}
else
valeditctrl.value=value;valeditctrl=null;}
if(msg!="")
alert(msg);submval=FindElem(obj.id).value;s_ar=submval.split("|");s_ar[c+4]=value.replace(/\/g,"\");FindElem(obj.id).value=s_ar.join("|");}
function StartEdit(obj,ctrl,c,r,iwclname)
{if(obj.onasynceditstart)
{tempval=document.getElementById(obj.id+"_INPUT").value;document.getElementById(obj.id+"_INPUT").value+="|cellval"+ctrl.value+"|cellr"+r+"|cellc"+c;processAjaxEvent('onEditStart',iwclname,''+obj.id+'.DoAsyncEditStart',true,null,true);document.getElementById(obj.id+"_INPUT").value=tempval;if(iwclname!="")
{AsyncUpdate(obj);}}}
function WGUpdEdit(obj,ctrl,c,r,iwclname)
{valeditctrl=ctrl;obj.clienteditdone(obj,ctrl,c,r);if(obj.onasynceditdone)
{tempval=document.getElementById(obj.id+"_INPUT").value;document.getElementById(obj.id+"_INPUT").value+="|cellval"+ctrl.value+"|cellr"+r+"|cellc"+c;processAjaxEvent('onEditDone',iwclname,''+obj.id+'.DoAsyncEditDone',true,null,true);document.getElementById(obj.id+"_INPUT").value=tempval;}
if(iwclname!="")
{AsyncUpdate(obj);}
cindex=-1;if((obj.coledit[c]=="Combo")&&(IsComboBoxPrompt(obj,c,cindex)))
{cindex=ctrl.selectedIndex;}
if(cindex==-1)
{submval=FindElem(obj.id).value;s_ar=submval.split("|");s_ar[c+4]=ctrl.value.replace(/\/g,"\").replace(/\r/g,"\n");FindElem(obj.id).value=s_ar.join("|");}}
function IsComboBoxPrompt(obj,c,selIndex)
{found=false;if(obj.combopromptindex[c]>=0)
{if(obj.combopromptindex[c]==selIndex)
found=true;}
else if(obj.combopromptindexlist[c]!="")
{if(obj.combopromptindexlist[c].indexOf(",")<0)
{if(obj.combopromptindexlist[c]>=0)
if(obj.combopromptindexlist[c]==selIndex)
found=true;}
else
{i_ar=obj.combopromptindexlist[c].split(",");for(i=0;i<i_ar.length;i++)
{if(i_ar==selIndex)
found=true;}}}
return found;}
function DirEditU(obj,ctrl,iwclname)
{lr=obj.editrow;lc=obj.editcol;UpdDirEdit(obj,ctrl,0,0,iwclname);if(lr>0)
{lr--;cellclick(obj,lr+1,lc+1,-1,iwclname);sT=document.body.scrollTop;sL=document.body.scrollLeft;if(isIE)
{gd=document.getElementById(obj.fids+'mg');gd.focus();}
else
{gd=document.getElementById(obj.id+"hi");gd.focus();}
document.body.scrollTop=sT;document.body.scrollLeft=sL;}}
function DirEditD(obj,ctrl,iwclname)
{lr=obj.editrow;lc=obj.editcol;UpdDirEdit(obj,ctrl,0,0,iwclname);if(lr<obj.rcount)
{lr++;cellclick(obj,lr+1,lc+1,-1,iwclname);sT=document.body.scrollTop;sL=document.body.scrollLeft;if(isIE){gd=document.getElementById(obj.fids+'mg');gd.focus();}else{gd=document.getElementById(obj.id+"hi");gd.focus();}
document.body.scrollTop=sT;document.body.scrollLeft=sL;}}
function DirEditL(obj,ctrl,iwclname)
{lr=obj.editrow;lc=obj.editcol;UpdDirEdit(obj,ctrl,0,0,iwclname);if(lc>0)
{lc--;}
cellclick(obj,lr+1,lc+1,iwclname);sT=document.body.scrollTop;sL=document.body.scrollLeft;if(isIE){gd=document.getElementById(obj.fids+'mg');gd.focus();}else{gd=document.getElementById(obj.id+"hi");gd.focus();}
document.body.scrollTop=sT;document.body.scrollLeft=sL;}
function DirEditR(obj,ctrl,iwclname)
{lr=obj.editrow;lc=obj.editcol;UpdDirEdit(obj,ctrl,0,0,iwclname);if(lc<obj.ccount-1)
{lc++;}
cellclick(obj,lr+1,lc+1,iwclname);sT=document.body.scrollTop;sL=document.body.scrollLeft;if(isIE){gd=document.getElementById(obj.fids+'mg');gd.focus();}else{gd=document.getElementById(obj.id+"hi");gd.focus();}
document.body.scrollTop=sT;document.body.scrollLeft=sL;}
function UpdDirEdit(obj,ctrl,c,r,iwclname,evt)
{c=obj.editcol;r=obj.editrow;obj.clienteditdone(obj,ctrl,c,r);if(obj.onasynceditdone)
{tempval=document.getElementById(obj.id+"_INPUT").value;document.getElementById(obj.id+"_INPUT").value+="|cellval"+ctrl.value+"|cellr"+r+"|cellc"+c;processAjaxEvent('onEditDone',iwclname,''+obj.id+'.DoAsyncEditDone',true,null,true);document.getElementById(obj.id+"_INPUT").value=tempval;}
submval=FindElem(obj.id).value;s_ar=submval.split("|");foundit=false;if(s_ar.length<7)
{for(i=s_ar.length;i<9;i++)
submval=submval+"|";}
for(i=1;i<=s_ar.length;i++)
{s_su=s_ar[i-1].split("^");if(s_su.length>1)
{if(s_su[0]=="E"+r+"C"+c)
{s_su[1]=ctrl.value;foundit=true;s_ar[i-1]=s_su.join("^");}}}
if(foundit==false)
submval=submval+"|E"+r+"C"+c+"^"+ctrl.value;else
submval=s_ar.join("|");FindElem(obj.id).value=submval;if(obj.seledit!="")
{ce=document.getElementById(obj.seledit);if(obj.coltype[c]=="Scroll")
ce.style.overflow="auto";if(obj.coltype[c]=="NoWrap")
ce.style.overflow="hidden";ce.innerHTML=ctrl.value;sT=document.body.scrollTop;sL=document.body.scrollLeft;obj.seledit="";if(isIE)
{gd=document.getElementById(obj.fids+'mg');gd.focus();}
else
{gd=document.getElementById(obj.id+"hi");gd.focus();}
document.body.scrollTop=sT;document.body.scrollLeft=sL;}
if(evt)
evt.cancelBubble=true;}
function CancelDirEdit(obj,ctrl,c,r,evt)
{c=obj.editcol;r=obj.editrow;if(obj.seledit!="")
{ce=document.getElementById(obj.seledit);if(obj.coltype[c]=="Scroll")
ce.style.overflow="auto";if(obj.coltype[c]=="NoWrap")
ce.style.overflow="hidden";if(obj.origval)
ce.innerHTML=obj.origval;else
ce.innerHTML="";obj.seledit="";sT=document.body.scrollTop;sL=document.body.scrollLeft;if(isIE)
{gd=document.getElementById(obj.fids+'mg');gd.focus();}
else
{gd=document.getElementById(obj.id+"hi");gd.focus();}
document.body.scrollTop=sT;document.body.scrollLeft=sL;}
if(evt)
evt.cancelBubble=true;}
function UpdCombo(obj,ctrl,c,r,iwclname)
{obj.clientcombochange(obj,ctrl,c,r)
if(IsComboBoxPrompt(obj,c,ctrl.selectedIndex))
{cval=prompt(obj.combopromptvalue[c],"");submval=FindElem(obj.id).value;s_ar=submval.split("|");if(obj.combopromptsave[c]==-1)
s_ar[c+4]=cval.replace(/\/g,"\");else
s_ar[c+4]=ctrl.value.replace(/\/g,"\");FindElem(obj.id).value=s_ar.join("|")
if(obj.onasynccomboprompt)
{tempval=document.getElementById(obj.id+"_INPUT").value;document.getElementById(obj.id+"_INPUT").value+="|ccellval"+cval+"|ccellr"+r+"|ccellc"+c+"|cindex"+ctrl.selectedIndex;processAjaxEvent('onComboPromptSetValue',iwclname,''+obj.id+'.DoAsyncComboPromptSetValue',true,null,true);document.getElementById(obj.id+"_INPUT").value=tempval;}
else if(obj.oncomboprompt)
return SubmitClick(obj.id,"ComboPromptSetValue"+r+":"+c+":"+ctrl.selectedIndex+":"+cval);}
else
{if(obj.onasynccombochange)
{tempval=document.getElementById(obj.id+"_INPUT").value;document.getElementById(obj.id+"_INPUT").value+="|cellval"+ctrl.value+"|cellr"+r+"|cellc"+c;processAjaxEvent('onComboChange',iwclname,''+obj.id+'.DoAsyncComboChange',true,null,true);document.getElementById(obj.id+"_INPUT").value=tempval;}
else if(obj.oncombochange)
return SubmitClick(obj.id,"ComboChange"+r+":"+c+":"+ctrl.value);}}
function DynaEdit(obj,ctrl,r,c){submval=FindElem(obj.id).value;s_ar=submval.split("|");foundit=false;for(i=1;i<=s_ar.length;i++){s_su=s_ar[i-1].split("^");if(s_su.length>1){if(s_su[0]=="D"+r+"C"+c){s_su[1]=ctrl.value;foundit=true;s_ar[i-1]=s_su.join("^");}}}
if(foundit==false)
submval=submval+"|D"+r+"C"+c+"^"+ctrl.value;else
submval=s_ar.join("|");FindElem(obj.id).value=submval;}
function UpdCheck(obj,ctrl,c,r)
{submval=FindElem(obj.id).value;s_ar=submval.split("|");if(ctrl.checked)
s_ar[c+4]="true";else s_ar[c+4]="false";FindElem(obj.id).value=s_ar.join("|");}
function DynaCheck(obj,ctrl,r,c)
{submval=FindElem(obj.id).value;s_ar=submval.split("|");foundit=false;for(i=1;i<=s_ar.length;i++){s_su=s_ar[i-1].split("^");if(s_su.length>1){if(s_su[0]=="D"+r+"C"+c){if(ctrl.checked)s_su[1]="1";else s_su[1]="0";foundit=true;s_ar[i-1]=s_su.join("^");}}}
if(foundit==false){if(ctrl.checked)
submval=submval+"|D"+r+"C"+c+"^1";else
submval=submval+"|D"+r+"C"+c+"^0";}else{submval=s_ar.join("|");}
FindElem(obj.id).value=submval;}
function DetailOpen(obj,r)
{dr=document.getElementById(obj.fids+'DET'+r);return(dr.style.display!="")}
function Toggle(obj,r)
{var s;obj.clientnodeclick(obj,r);dr=document.getElementById(obj.fids+'DET'+r);if(typeof(dr)=="undefined")return;if((obj.detailrowshow=="dsOneOpen")||(obj.detailrowshow=="dsServerOneOpen"))
{for(i=1;i<=obj.rowsonpage;i++){if(i!=r){dr=document.getElementById(obj.fids+'DET'+i);if(dr.style.display==""){obj.detailstate[i-1]="0";dr.style.display="none";document.getElementById(obj.fids+'NOC'+i).style.display="none";document.getElementById(obj.fids+'NOE'+i).style.display="";}}}}
if(document.getElementById(obj.fids+'DET'+r))
{dr=document.getElementById(obj.fids+'DET'+r);if(dr.style.display=="none"){dr.style.display="";obj.detailstate[r-1]="1";document.getElementById(obj.fids+'NOC'+r).style.display="";document.getElementById(obj.fids+'NOE'+r).style.display="none";}else{dr.style.display="none";obj.detailstate[r-1]="0";document.getElementById(obj.fids+'NOC'+r).style.display="none";document.getElementById(obj.fids+'NOE'+r).style.display="";}
for(i=1;i<=obj.detailstate.length;i++){if(i>1)
s=s+obj.detailstate[i-1];else
s=obj.detailstate[i-1];}
submval=FindElem(obj.id).value;s_ar=submval.split("|");s_ar[3]=s;FindElem(obj.id).value=s_ar.join("|");}
if((obj.onnodeopen)||(obj.detailrowshow=="dsServerOpen")||(obj.detailrowshow=="dsServerOneOpen")){if(!DetailOpen(obj,r))
return SubmitClick(obj.id,"NodeOpen"+r);}
if((obj.onnodeclose)||(obj.detailrowshow=="dsServerOpen")||(obj.detailrowshow=="dsServerOneOpen")){if(DetailOpen(obj,r))
return SubmitClick(obj.id,"NodeClose"+r);}}
function CToggle(obj,r,c,iwclname)
{obj.clientcheckclick(obj,c,r);dr=document.getElementById(obj.fids+'CKT'+r);if(dr.style.display=="none"){document.getElementById(obj.fids+'CKT'+r).style.display="";document.getElementById(obj.fids+'CKF'+r).style.display="none";obj.cellstate[r]="0";}else{document.getElementById(obj.fids+'CKT'+r).style.display="none";document.getElementById(obj.fids+'CKF'+r).style.display="";obj.cellstate[r]="1";}
for(i=1;i<=obj.ccount;i++){s=obj.fids+"c"+i+"r"+(r+1);if(obj.showselect){if(obj.cellstate[r]=="1"){document.getElementById(s).style.backgroundColor=obj.selectcolor;document.getElementById(s).style.color=obj.selectfontcolor;}else{if(obj.bands){if(r%2==1)
document.getElementById(s).style.backgroundColor=obj.scol;else
document.getElementById(s).style.backgroundColor=obj.pcol;}else{document.getElementById(s).style.backgroundColor=obj.columncolors[i-1];document.getElementById(s).style.color=obj.fontcolor;}}}}
for(i=1;i<=obj.cellstate.length;i++){if(i>1)
s=s+obj.cellstate[i-1];else
s=obj.cellstate[i-1];}
submval=FindElem(obj.id).value;s_ar=submval.split("|");s_ar[0]=s;FindElem(obj.id).value=s_ar.join("|");if(obj.onasynccheckclick)
{tempval=document.getElementById(obj.id+"_INPUT").value;document.getElementById(obj.id+"_INPUT").value+="|cellr"+(r+1)+"|cellc"+c;processAjaxEvent('onCheckClick',iwclname,''+obj.id+'.DoAsyncCheckClick',true,null,true);document.getElementById(obj.id+"_INPUT").value=tempval;}
else if(obj.oncheckclick)
return SubmitClick(obj,"CheckClick"+(r+1)+":"+c);}
function ToggleAll(obj)
{dr=document.getElementById(obj.fids+'NOE0');for(ci=1;ci<=obj.rowsonpage;ci++)
{if(dr.style.display=="none"){document.getElementById(obj.fids+'DET'+ci).style.display="none";document.getElementById(obj.fids+'NOC'+ci).style.display="none";document.getElementById(obj.fids+'NOE'+ci).style.display="";}else{document.getElementById(obj.fids+'DET'+ci).style.display="";document.getElementById(obj.fids+'NOC'+ci).style.display="";document.getElementById(obj.fids+'NOE'+ci).style.display="none";}}
dr=document.getElementById(obj.fids+'NOE0');if(dr.style.display=="none")
dr.style.display="";else
dr.style.display="none";dr=document.getElementById(obj.fids+'NOC0');if(dr.style.display=="none")
dr.style.display="";else
dr.style.display="none";}
function RowHover(obj,r,numc,active)
{obj.clienthoverrow(obj,r);for(i=1;i<=numc;i++){s=obj.fids+"c"+i+"r"+r;el=document.getElementById(s);if(active)
{el.style.backgroundColor=obj.hovercolor;if(el.firstChild.tagName=="FONT")
el.firstChild.style.color=obj.hoverfontcolor;el.style.color=obj.hoverfontcolor;}
else
{if((obj.cellstate[r-1]=="1")&&(obj.showselect))
{el.style.backgroundColor=obj.selectcolor;el.style.color=obj.selectfontcolor;if(el.firstChild.tagName=="FONT")
el.firstChild.style.color=obj.selectfontcolor;}
else
if(obj.bands)
{if(r%2==1)
el.style.backgroundColor=obj.scol;else
el.style.backgroundColor=obj.pcol;el.style.color=obj.coltextcolors[i-1];if(el.firstChild.tagName=="FONT")
el.firstChild.style.color=obj.coltextcolors[i-1];}
else
{el.style.backgroundColor=obj.columncolors[i-1];el.style.color=obj.coltextcolors[i-1];if(el.firstChild.tagName=="FONT")
el.firstChild.style.color=obj.coltextcolors[i-1];}
if(obj.cellstate[r-1]!="1")
{if(obj.pageoffset==(r-1))
{if(obj.activerowcolor!="")
el.style.backgroundColor=obj.activerowcolor;if(obj.activerowfontcolor!="")
{el.style.color=obj.activerowfontcolor;if(el.firstChild.tagName=="FONT")
el.firstChild.style.color=obj.activerowfontcolor;}}}}}}
function clientclick(obj,c,r)
{obj.selcol=c;obj.selrow=r;obj.clientcellclick(obj,c,r);}
function gridkeydown(obj,c,r)
{obj.selcol=c;obj.selrow=r;}
function editclick(obj,c,r,ch,iwclname)
{ffgridclick=true;if(shiftTab)
{shiftTab=false;return false;}
cellunselect(obj,r,c);obj.clientcellclick(obj,c,r);if(obj.seledit!="")return;sn=obj.fids+"D"+r+"C"+c;if(c==-1){alert("Invalid row - 1 clicked");}
obj.editcol=c;obj.editrow=r;el=document.getElementById(sn);if(el==null)return;if(el.innerText)
cval=el.innerText;else
cval=el.textContent;obj.origval=cval;sne="HE"+obj.fids+"C"+c;he=document.getElementById(sne);if(he==null)return;obj.seledit=sn;if((obj.coltype[c]=="Scroll")||(obj.coltype[c]=="NoWrap"))
el.style.overflow="visible";el.innerHTML=he.innerHTML;sne="L"+obj.fids+"C"+c;ed=document.getElementById(sne);if(ed!=null)
{if((cval!="&nbsp;")&&(cval))
{ed.value=cval;if(obj.coledit[c]=="Combo")
{if(ed.selectedIndex<=0)
{for(i=0;i<ed.options.length;i++)
{if(ed.options.text==cval)
ed.selectedIndex=i;}}}}
else
ed.value="";ed.focus();}
else
obj.seledit="";if(ch!=-1)
ed.value="";if((obj.onasyncedit)&&(iwclname))
{tempval=document.getElementById(obj.id+"_INPUT").value;document.getElementById(obj.id+"_INPUT").value+="|editrow"+r;processAjaxEvent('onEdit',iwclname,''+obj.id+'.DoAsyncEdit',true,null,true);document.getElementById(obj.id+"_INPUT").value=tempval;}}
function cellhilight(obj,r,c)
{ns=obj.fids+"c"+c+"r"+r;os=obj.fids+"c"+obj.selcol+"r"+obj.selrow;if(obj.showselect){if((obj.selcol!=-1)&&(obj.selrow!=-1)){if(obj.bands){if(obj.selrow%2==1)
document.getElementById(os).style.backgroundColor=obj.scol;else
document.getElementById(os).style.backgroundColor=obj.pcol;}else{document.getElementById(os).style.backgroundColor=obj.columncolors[c-1];}
document.getElementById(os).style.color=obj.coltextcolors[c-1];}
document.getElementById(ns).style.backgroundColor=obj.selectcolor;document.getElementById(ns).style.color=obj.selectfontcolor;}
obj.selcol=c;obj.selrow=r;ns=obj.fids+"D"+(r-1)+"C"+(c-1);nsc=document.getElementById(ns);if(nsc!=null)
nsc.scrollIntoView(false);}
function cellunselect(obj,r,c)
{if(obj.showselect){if((obj.selcol!=-1)&&(obj.selrow!=-1)){os=obj.fids+"c"+obj.selcol+"r"+obj.selrow;if(obj.ands){if(obj.selrow%2==1)
document.getElementById(os).style.backgroundColor=obj.scol;else
document.getElementById(os).style.backgroundColor=obj.pcol;}else{document.getElementById(os).style.backgroundColor=obj.columncolors[c-1];}
document.getElementById(os).style.color=obj.coltextcolors[c-1];}}}
function cellclick(obj,r,c,iwclname)
{s=obj.fids+"c"+c+"r"+r;os=obj.fids+"c"+obj.selcol+"r"+obj.selrow;if(obj.autoedit){if((obj.selcol==c)&&(obj.selrow==r)&&(1>0))
return SubmitClick(obj.id,"EditClick"+r+":"+c)}else{if((obj.selcol==c)&&(obj.selrow==r)&&(1<0))
return SubmitClick(obj.id,"EditClick"+r+":"+c)}
if(obj.showselect){if((obj.selcol!=-1)&&(obj.selrow!=-1)){if(obj.ands){if(obj.selrow%2==1)
document.getElementById(os).style.backgroundColor=obj.scol;else
document.getElementById(os).style.backgroundColor=obj.pcol;}else{document.getElementById(os).style.backgroundColor=obj.columncolors[c-1];}
document.getElementById(os).style.color=obj.coltextcolors[c-1];}
document.getElementById(s).style.backgroundColor=obj.selectcolor;document.getElementById(s).style.color=obj.selectfontcolor;}
if(c==-1){alert('Invalid row -1 clicked');}
obj.selcol=c;obj.selrow=r;if(obj.scrollintoview)
{s=obj.fids+"D"+(r-1)+"C"+(c-1);nsc=document.getElementById(s);if(nsc!=null)
nsc.scrollIntoView(false);}
if(obj.onasynccellclick)
{tempval=document.getElementById(obj.id+"_INPUT").value;document.getElementById(obj.id+"_INPUT").value+="|cellr"+(r-1)+"|cellc"+(c-1);processAjaxEvent('onCellClick',iwclname,''+obj.id+'.DoAsyncCellClick',true,null,true);document.getElementById(obj.id+"_INPUT").value=tempval;}
else if(obj.oncellclick)
return SubmitClick(obj.id,"CellClick"+r+":"+c);if(obj.onvalueclick)
return SubmitClick(obj.id,"ValClick"+r+":"+c+":"+obj.id+"GetCellValue(c-1,r-1)");}
function cellrowclick(obj,r,c,numc)
{if((obj.selrow==r)&&(obj.autoedit)){return SubmitClick(obj.id,"EditClick"+r+":"+c)}
for(i=1;i<=numc;i++){s=obj.fids+"c"+i+"r"+r;os=obj.fids+"c"+i+"r"+obj.selrow;if(obj.showselect){if(obj.selrow!=-1){if(obj.bands){if(obj.selrow%2==1)
document.getElementById(os).style.backgroundColor=obj.scol;else
document.getElementById(os).style.backgroundColor=obj.pcol;}else{document.getElementById(os).style.backgroundColor=obj.columncolors[i-1];}
if(obj.coltype=="Popup")
document.getElementById(obj.fids+"pdt"+obj.selrow+"c"+(i+1)).style.color=obj.fontcolor;document.getElementById(os).style.color=obj.fontcolor;}
document.getElementById(s).style.backgroundColor=obj.selectcolor;if(obj.coltype=="Popup")
document.getElementById(obj.fids+"pdt"+r+"c"+(i+1)).style.color=obj.selectfontcolor;document.getElementById(s).style.color=obj.selectfontcolor;}}
if(c==-1){alert("Invalid row -1 clicked");}
obj.selcol=c;obj.selrow=r;if(obj.oncellclick)
return SubmitClick(obj.id,"CellClick"+r+":"+c);}
var objMyEl="";function ExpClose()
{objMyEl.style.visibility="hidden";objMyel="";}
function ExpClick(obj,el)
{el.style.visibility="visible";obj.myEl=el;objMyEl=obj.myEl;document.onmouseup=ExpClose;}
function PopClick(obj,el,txt,r,c)
{el.style.visibility="visible";obj.myEl=el;iH=document.getElementById(txt).innerHTML;ta=document.getElementById(obj.fids+"TA"+r+"c"+c);if(ta)
{var elval=iH.replace(/<BR>/g,"\n").replace(/<br>/g,"\n").replace(/&lt;/g,"<").replace(/&gt;/g,">");ta.value=elval;ta.focus()}}
function PopOk(obj,ctrl,cellid,c,r,iwclname)
{obj.clientpopupeditok(obj,ctrl,cellid,c,r);obj.myEl.style.visibility="hidden";var el=document.getElementById(obj.fids+"TA"+r+"c"+c);if(ie)
elval=el.innerHTML;else
{elval=el.value;elval=elval.replace(/</g,"&lt;").replace(/>/g,"&gt;");}
elval=elval.replace(/\n/g,"<BR>").replace(/\r/g,"");SetElText(obj,cellid,elval);WGUpdEdit(obj,el,c,r,iwclname);}
function PopCancel(obj,ctrl,c,r)
{obj.clientpopupeditcancel(obj,ctrl,c,r);obj.myEl.style.visibility="hidden";}
function colsizedwn(obj,ctrl,e)
{document.onmouseup=colsizedone;document.onmousemove=obj.colsizemove;if(ie)
{obj.szw=window.event.x;obj.event=window.event;}
else
{obj.szw=e.pageX;obj.event=e;}
obj.mvc=ctrl
s=obj.fids+"c"+obj.mvc+"r1";obj.origval=parseInt(document.getElementById(s).width);obj.origwidth=parseInt(document.getElementById(obj.fids+"mg").width);obj.origfullwidth=parseInt(document.getElementById(obj.fids+"mg").firstChild.firstChild.width);}
function colsizedone()
{document.onmousemove=null;document.onmouseup=null;}
var WGtempval="";function WGKeyUp(ctrl)
{if(!isIE)
{if(ctrl.value.lastIndexOf('-')>0)
{ctrl.value=WGtempval;}}}
function WGGetSelText()
{var txt='';if(document.selection)
txt=document.selection.createRange().text;return txt;}
function HandleMin(ctrl,sgn)
{if(sgn)
{s=ctrl.value;if(WGGetSelText().length==s.length)
s='';if(s.indexOf('-')==-1)
ctrl.value='-'+s;else
ctrl.value=s.substring(1);}}
function KeyDown(obj,ctrl,c,r,event)
{if(isIE)
{key=(isIE)?event.keyCode:event.which;if(key==39)
{var r1=document.selection.createRange();var r2=document.selection.createRange();r2.move("character",1);if(r2.compareEndPoints("StartToEnd",r1)==0)
{event.keyCode=0;NextEditH(obj,c,r);if(isIE)
event.returnValue=false;else
return false;}}
if(key==37)
{var r1=document.selection.createRange();var r2=document.selection.createRange();r2.move("character",-1);if(r2.compareEndPoints("StartToEnd",r1)==0)
{event.keyCode=0;PrevEditH(obj,c,r);if(isIE)
event.returnValue=false;else
return false;}}}}
function DirKeyDown(obj,event,ctrl,c,r,iwclname)
{key=(isIE)?event.keyCode:event.which;if(!isIE)
ffarrowkeydown=true;if(key==38)DirEditU(obj,ctrl,iwclname);if(key==40)DirEditD(obj,ctrl,iwclname);if((key==13)&&(obj.advanceonreturn==true))DirEditR(obj,ctrl);if((key==9)&&(event.shiftKey)){shiftTab=true;if(isIE)
{document.getElementsByTagName("body")(0).focus();}}}
function KeyPress(obj,ctrl,edittype,event,signed,c,r,prec,edit)
{WGtempval=ctrl.value;key=(isIE)?event.keyCode:event.which;var clientreturn=null;if(edit==1)
clientreturn=obj.clienteditchange(obj,ctrl,c,r);else if(edit==2)
clientreturn=obj.clientdyneditchange(obj,ctrl,c,r);if(clientreturn==false)
{return false;}
if((key==8)||(key==0))
return;if(key==13)
{if(obj.advanceonreturn)
{NextEditH(obj,c,r);}
if(isIE)
event.returnValue=false;else
return false;}
if(edittype==1){if(key==45)
{if(isIE)
{if((WGGetSelText().length!=ctrl.value.length))
{HandleMin(ctrl,signed)
event.returnValue=false;}}}
else if(key<48||key>57){if(isIE)
event.returnValue=false;else
return false;}}
if(edittype==2){if(ie){}
if(document.getSelection){}
if(key)code=key;var character=String.fromCharCode(code);if(key==45)
{if(isIE)
{if((WGGetSelText().length!=ctrl.value.length))
{HandleMin(ctrl,signed)
event.returnValue=false;}}}
else if((key<48||key>57)&&(key!=obj.decimalpoint)){if(isIE)event.returnValue=false;else return false;}
if(key==obj.decimalpoint){if((ctrl.value.indexOf(String.fromCharCode(obj.decimalpoint))!=-1)||(ctrl.value.length==0)){if(isIE)event.returnValue=false;else return false;}}
if((key>=48)&&(key<=57)&&(prec>0)&&(ctrl.value.indexOf(String.fromCharCode(obj.decimalpoint))!=-1)){if(ctrl.value.length-ctrl.value.indexOf(String.fromCharCode(obj.decimalpoint))>prec)return false;}}
if(edittype==3){if(key>96&&key<123){if(isIE){event.keyCode=key-32;}
else{ctrl.value+=String.fromCharCode(event.which-32);return false;}}}
if(edittype==5)
{if(key>64&&key<91)
{if(isIE)
event.keyCode=key+32;else
{ctrl.value+=String.fromCharCode(event.which+32);return false;}}}
if(edittype==6){if(((key>47&&key<58))||((key>64)&&(key<71)))
key=key;else
if(key>96&&key<103)
key=key-32;else
if(isIE)event.returnValue=false;else return false;}
if(edittype==4){}}
function SetElText(obj,id,txt)
{el=document.getElementById(id);if(isIE)
el.innerHTML=txt;else
el.textContent=txt;}
function FormatNum(obj,num,precision,decp)
{if(obj.hasdynedits)
{m=Math.pow(10,precision);n=Math.round(numm)/m;m=Math.pow(0.1,precision+1);n=n+"";ms=m+"";if(n.indexOf(".")!=-1)
ms=ms.substring(ms.indexOf(".")+1,ms.indexOf(".")+precision+1);else
ms=ms.substring(ms.indexOf("."),ms.indexOf(".")+precision+1);n=n+ms;if(precision==0)
return n.substring(0,n.indexOf("."));else
return n.substring(0,n.indexOf(".")+precision+1).replace(".",decp);}}
function GetEditRow(obj)
{return obj.pageoffset;}
function IsEditing(obj)
{if(obj.dstate=="gsEdit")
return true;if(obj.dstate=="gsInsert")
return false;}
function GetCellValue(obj,c,r)
{return document.getElementById(obj.fids+"D"+r+"C"+c).innerHTML;}
function SetCellValue(obj,c,r,s)
{SetElText(obj,obj.fids+"D"+r+"C"+c,s);}
function GetEditValue(obj,c,r)
{return document.getElementById(obj.fids+"D"+r+"C"+c).value;}
function SetEditValue(obj,c,r,s)
{edctrl=document.getElementById(obj.fids+"D"+r+"C"+c);edctrl.value=s;submval=FindElem(obj.id).value;s_ar=submval.split("|");s_ar[c+4]=edctrl.value;FindElem(obj.id).value=s_ar.join("|");}
function ColumnSum(obj,c)
{tot=0;colval=0;for(i=0;i<obj.rowsonpage;i++)
{var el=document.getElementById(obj.fids+"D"+i+"C"+c);if(isIE)
colval=el.innerHTML;else
colval=el.textContent;tot=tot+1
colval;}
return tot;}
function ColumnAvg(obj,c)
{tot=0;colval=0;for(i=0;i<obj.rowsonpage;i++)
{if(isIE)
colval=document.getElementById(obj.fids+"D"+i+"C"+c).innerHTML;else
colval=document.getElementById(obj.fids+"D"+i+"C"+c).textContent;tot=tot+1colval;}
return tot/obj.rowsonpage;}
function ColumnMin(obj,c)
{tot=0;colval=0;for(i=0;i<obj.rowsonpage;i++)
{if(isIE)
colval=document.getElementById(obj.fids+"D"+i+"C"+c).innerHTML;else
colval=document.getElementById(obj.fids+"D"+i+"C"+c).textContent;if(i==0)
tot=1
colval;else{if(tot>1colval)
tot=1
colval;}}
return tot;}
function ColumnMax(obj,c)
{tot=0;colval=0;for(i=0;i<obj.rowsonpage;i++)
{if(isIE)
colval=document.getElementById(obj.fids+"D"+i+"C"+c).innerHTML;else
colval=document.getElementById(obj.fids+"D"+i+"C"+c).textContent;if(i==0)
tot=1colval;else{if(tot<1colval)
tot=1colval;}}
return tot;}
function ColumnSumE(obj,c)
{tot=0;colval=0;for(i=0;i<obj.rowsonpage;i++)
{colval=document.getElementById(obj.fids+"D"+i+"C"+c).value;tot=tot+1
colval;}
return tot;}
function ColumnAvgE(obj,c)
{tot=0;colval=0;for(i=0;i<obj.rowsonpage;i++)
{colval=document.getElementById(obj.fids+"D"+i+"C"+c).value;tot=tot+1colval;}
return tot/obj.rowsonpage;}
function ColumnMinE(obj,c)
{tot=0;colval=0;for(i=0;i<obj.rowsonpage;i++)
{colval=document.getElementById(obj.fids+"D"+i+"C"+c).value;if(i==0)
tot=1
colval;else{if(tot>1colval)
tot=1
colval;}}
return tot;}
function ColumnMaxE(obj,c)
{tot=0;colval=0;for(i=0;i<obj.rowsonpage;i++)
{colval=document.getElementById(obj.fids+"D"+i+"C"+c).value;if(i==0)
tot=1colval;else{if(tot<1colval)
tot=1*colval;}}
return tot;}
function ImgPopup(img,w,h,v)
{img.width=w;img.height=h;}
function NextEdit(obj,c,r)
{if(r<obj.rcount-1)
r++;el=document.getElementById(obj.fids+"D"+r+"C"+c);if(typeof(el)=="undefined"){el=document.getElementById(obj.fids+"D0C"+c);if(typeof(el)=="undefined")
return;}
el.focus();if(obj.editselectall)
el.select();}
function PrevEdit(obj,c,r)
{if(r>0)
r--;el=document.getElementById(obj.fids+"D"+r+"C"+c);el.focus();if(obj.editselectall)
el.select();}
function NextEditH(obj,c,r)
{var nc=c;var nr=r;if(nc<obj.ccount-1)
nc++;el=document.getElementById(obj.fids+"D"+r+"C"+nc);if(typeof(el)=="undefined"){nr++;el=document.getElementById(obj.fids+"D"+nr+"C"+c);if(typeof(el)=="undefined"){return false;}}
el.focus();{var s=document.selection.createRange();s.queryCommandText("unselect");if(obj.editselectall)
el.select();}}
function PrevEditH(obj,c,r)
{if(c>0)
c--;el=document.getElementById(obj.fids+"D"+r+"C"+c);if(typeof(el)=="undefined")
return;el.focus();var r=document.selection.createRange();r.queryCommandText("unselect");if(obj.editselectall)
el.select();}
function DoScrollIntoView(obj)
{if(obj.scrollintoview)
{s=obj.fids+"c1r"+(obj.pageoffset+1);nsc=document.getElementById(s);if(nsc!=null)
nsc.scrollIntoView(false);}}

This issue has now been fixed.
The update will be available with the next release of the TMS IW Component Pack.

any workaround ?

any advice till then?
Changing the ColumnType from ctDynText to ctDynEdit in the GetCellType is the cause of the JavaScript error.
As a workaround you can disable the GetCellType event and use an external IWEdit control to enable user input for the "total".

If you urgently require the update, you can send an email with a request for an incremental source update to mailto:info@tmssoftware.com

can you help me with a javascript for the computation ?

 
gridTable = the grid
edOffset = the edit for imput
edTotal = the edit for reflecting the value.
 
tks alot