// ----------------------------------------------------------------------------------------------------------- MS.Paging$Tree$ReloadBody; TGP.FillPage = function(row){ var SS = this.GetSS(), page = row.Page, next = this.ReversedTree ? "previousSibling" : "nextSibling", r; if(!page && this.ChildParts) this.GetChildPartsHTML(row,SS); else this.GetPageHTML(row,SS); for(var i=this.FirstSec;i<=this.LastSec;i++) if(SS[i]){ if(page) r = row["r"+i]; else { r = row["r"+i]; r = r ? r[next] : row["rch"+i]; } if(!r) continue; if(BTouch) { r.ontouchstart; r.ontouchstart = null; if(!BTablet) r.setAttribute("ontouchstart",""); } r.onmousemove; r.onmousemove = null; if(page){ r.innerHTML = SS[i].join(""); r.style.overflow = ""; r.style.height = ""; if(!this.AllPaging) r.style.width = ""; } else { r.style.height = ""; r.style.display = ""; r.firstChild.firstChild.innerHTML = SS[i].join(""); } } row.State = 4; if(!row.Page) row.Hasch = 4; this.Refresh(); try { if(LZDX.length>=50) this.UpdatePage(row); } catch(e) { } MS.RowSpan; if(row.RowSpan) this.UpdateRowSpan(row,1); ME.RowSpan; } ME.Paging$Tree$ReloadBody; // ----------------------------------------------------------------------------------------------------------- MS.ChildParts; TGP.GetRowFromHTML = function(r){ if(this.SetIds) { var M = r.onmousemove; if(!M) M = r.getAttribute("onmousemove"); M = M.toString().match(/(?:\')(.+)(?:\')|(?:\")(.+)(?:\")|(?:Rows\s*[\.\[])([^\;\]\"\']+)(?=\s*[;\]])/); return this.Rows[(M[1]?M[1]:(M[2]?M[2]:M[3])).replace(/(?:\\)(.)/g,"$1")]; } return r.row; } ME.ChildParts; // ----------------------------------------------------------------------------------------------------------- MS.ChildParts; TGP.RenderChildPart = function(row,num,reloadindex){ if(!row.r1&&!row.rch1 || this.Loading || reloadindex!=null && this.ReloadIndex!=reloadindex) return; if(Grids.OnRenderChildPartStart) Grids.OnRenderChildPartStart(this,row,num); var ch = this.GetRowChildren(row,1); if(!ch) return; ch = ch.firstChild; if(!ch) return; ch = ch.firstChild; if(!ch) return; ch = ch.childNodes[num]; if(!ch) return; if(ch.offsetHeight<5) return; var fr,lr = null, rc = this.ChildPartLength, next = this.ReversedTree ? "previousSibling" : "nextSibling";; for(var p=ch.previousSibling,cnt=0;p&&(!p.firstChild||p.firstChild.nodeType!=1);p=p.previousSibling) if(p.offsetHeight>=5) cnt++; if(p){ fr = p.firstChild.rows; fr = fr[fr.length-1]; fr = this.GetRowFromHTML(fr.onmousemove?fr:fr.previousSibling); cnt = cnt*rc + 1; } else { fr = row.firstChild; while(fr&&!fr.Visible&&!(fr.Expanded&2)) fr = this.GetNext(fr); if(cnt) cnt = cnt*rc; } for(var i=0;i1){ for(var i=this.FirstSec;i=2) this.UpdateOverlays(row); ME.Overlay; if(this.FRow==row && row.Page){ this.Focus(this.PagePosToRow(row,this.FPagePos),this.FCol,null,null,2); this.FPagePos = null; } else this.SetScrollRow(rt); this.Undo = zu; MS.Debug; if(this.DebugFlags["page"]) this.Debug(3,"Page "+(row.Page?row.Pos:row.id)+" rendered in ",this.EndTimer("PageRender"+(row.Page?row.Pos:row.id))," ms"); ME.Debug; if(this.ScrollAlign) this.DoScrollAlign(); if(Grids.OnRenderPageFinish) Grids.OnRenderPageFinish(this,row); MS.Paging; this.ShowPages(); ME.Paging; if(this.ShowPrintPageBreaks>0) this.CallUpdatePrintPageBreaks = 2; } ME.Paging$Tree$ReloadBody; // ----------------------------------------------------------------------------------------------------------- BFA = ["1T5_","noitacol","emantsoh","tsohlacol","1.0"+".0.721",".01",".861.291"]; // ----------------------------------------------------------------------------------------------------------- // Connects rows in page data through rows in HTML and sets onmousemove event TGP.UpdatePage = function(row,fr,lr,num){ var r = row.firstChild, rev = this.ReversedTree, next = rev ? "previousSibling" : "nextSibling"; var c1 = this.FirstSec, c2 = this.LastSec+1, k, H = {}, R = {}, RC = R; for(k=c1;k2) r.State = 2; if(r.firstChild) ClearChildren(r); } } if(!H[c1] || H[c1].nodeType!=1){ ClearChildren(row); return; } var F = this.SetIds?null:new Function(this.This+".ARow=this.row;"+this.This+".ASec=0;"); var orr = Grids.OnRenderRow!=null; while(r!=lr){ var v = r.Visible || rs&&r.r1; if(v) { MS.ReversedTree; if(rev && r.Hasch) for(k=c1;k2) r.State = 2; } } MS.Tree; if(r.Hasch){ if(r.Hasch==4) { if(cp){ MS.ChildParts; if(rs){ var HH = []; for(k=c1;k1; for(k=c1;k=2){ MS.Group; if(this.OnePage&4 && !nogroup && (this.Group||p.Group) && this.Group!=p.Group) { if(p.Group) { var Cols = this.Group, grouped = this.Grouped; this.Grouped = 0; this.DoGrouping(""); this.Group = Cols; this.Grouped = grouped; } if(this.GroupRestoreSort && this.SortGroup==null) this.SortGroup = this.Sort; this.GroupAll(1); this.Calculate(0,1); } ME.Group; MS.Filter; if(this.OnePage&2) this.UpdateGridFilter(); ME.Filter; if(this.OnePage&1) this.SortChildren(p); } } else if(scroll){ var A = this.GetShowedPages(); for(var i=0;i"; this.UpdatePages(); this.UpdateEmptyRows(); this.UpdateHeights(0,1); this.HideMessage(); if(fr){ if(!fr.Visible&&!fr.Page) this.Focus(); else if(!scroll && !fr.Fixed) this.ScrollIntoView(fr,this.FCol,this.FPagePos); } MS.Pager; if(this.Paging) this.UpdatePager(); ME.Pager; this.UpdateCursors(); this.ReColor(); this.Update(); if(this.ShowPrintPageBreaks>0&&this.CallUpdatePrintPageBreaks<2) this.CallUpdatePrintPageBreaks = 2; this.FocusFocused(); MS.Debug; this.Debug(4,"TreeGrid updated in ",this.EndTimer("RenderBody")," ms"); ME.Debug; } // ----------------------------------------------------------------------------------------------------------- TGP.RerenderBody = function(txt,scroll){ this.ShowMessage(txt?txt:this.GetText("UpdateGrid")); var T = this; setTimeout(function(){ T.RenderBody(scroll);},10); } // ----------------------------------------------------------------------------------------------------------- TGP.RefreshSection = function(vsec,sec){ if(!this.BodySec) return; MS.Animate; this.FinishAnimations(); ME.Animate; this.FirstSecRef = this.FirstSec; this.LastSecRef = this.LastSec; this.FirstSec = sec; this.LastSec = sec; var cp = this.ColPaging; this.ColPaging = 2; var SS = []; SS[sec] = []; this.RenderingSection = 1; if(vsec==0 && this.HeadSec[sec]) { this.GetPageHTML(this.XH,SS); this.HeadSec[sec].innerHTML = SS[sec].join(""); this.UpdateFixed(this.XH,this.HeadSec); } else if(vsec==1 && this.BodySec[sec]) { for(var row=this.XB.firstChild;row;row=row.nextSibling){ var r = row["r"+sec]; if(!r || row.State!=4) continue; SS[sec] = []; this.GetPageHTML(row,SS); r.innerHTML = SS[sec].join(""); this.UpdatePage(row); } } else if(vsec==2 && this.FootSec[sec]) { this.GetPageHTML(this.XF,SS); this.FootSec[sec].innerHTML = SS[sec].join(""); this.UpdateFixed(this.XF,this.FootSec); } this.FirstSec = this.FirstSecRef; this.LastSec = this.LastSecRef; this.ColPaging = cp; this.RenderingSection = null; this.UpdateHeights(-1); this.NoUpdateHeights = null; if(this.ShowPrintPageBreaks>0&&this.CallUpdatePrintPageBreaks<2) this.CallUpdatePrintPageBreaks = 2; } // ----------------------------------------------------------------------------------------------------------- MS.Paging$Tree; TGP.ShowPageMessage = function(row,txt){ MS.Message; if(this.SuppressMessage>=3 || !row.Page&&!row.Hasch) return; var scr = this.GetScrollLeft(1); for(var i=1;iscr+100) break; scr -= this.ColNames[i].Width; } if(r && r.firstChild && r.firstChild.className == this.Img.Style+"ChildPart"+(this.DynamicBorder?"Border":"")) r = r.firstChild; if(r) ShowMessageCenter(this.GetText(txt),r,this.Img.Style+"PageMessage",this.GetBodyHeight(),this.PageMessageWidth,scr); ME.Message; } ME.Paging$Tree; // -----------------------------------------------------------------------------------------------------------