View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0002914 | JEDI VCL | 00 JVCL Components | public | 2005-04-27 02:31 | 2006-01-24 02:19 |
Reporter | ivan_ra | Assigned To | AHUser | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | 3.00 | ||||
Target Version | Fixed in Version | 3.20 | |||
Summary | 0002914: TJvDBTreeView - working with BIG trees | ||||
Description | TJvDBTreeView performs unnessesary updates of tree. When tree is small it is not big problem, but with big trees its takes significant time. Cause of trouble is in procedure TJvCustomDBTreeView.DataChanged; ... if (RecCount = -1) or (RecCount <> OldRecCount) then UpdateTree; ... Value of OldRecCount is othen wrong. This is is solution for some cases: procedure TJvCustomDBTreeView.RefreshChild(ANode: TJvDBTreeNode); ... if ANode=nil then oldRecCount := FDataLink.DataSet.RecordCount; // ivan_ra end; procedure TJvCustomDBTreeView.UpdateTree; ... oldRecCount := FDataLink.DataSet.RecordCount; // ivan_ra end; | ||||
Tags | No tags attached. | ||||
|
Please try with the latest version of the JVCL from CVS as there were improvements made to the treeviews. Let us know how it goes. |
|
I looked in source-latest.zip. Problem is remains. For example: 1. I insert new record into tree; 2. I call UpdateTree method. On big tree it takes some time; 3. After that I try to browse tree. And now lets see what happens in code: 1. Invokes DataChanged method and OldRecCount becomes -1 2. Tree updated but still OldRecCount = -1 3. once again invokes DataChanged method and because OldRecCount = -1 tree updates again. With my fixes in clause 2 oldRecCount becomes = FDataLink.DataSet.RecordCount, so in clause 3 tree not updates RefreshChild(nil) is just as UpdateTree |
|
oldRecCount simple means old known count of records in dataset. This field uses as criteria when we want to know, is tree changed or not (look at DataChanged code). When tree rebuilded, we can tell with confidence: contents of dataset and tree identical. Tree entirely updates in procedures UpdateTree and RefreshChild(nil). So, when we successfully exit fom this procedures, we can assume what we do not need to update tree again. Therefore I suggest to add this code to the end of this procedures: oldRecCount := FDataLink.DataSet.RecordCount procedure TJvCustomDBTreeView.RefreshChild(ANode: TJvDBTreeNode); ... if ANode=nil then oldRecCount := FDataLink.DataSet.RecordCount; end; procedure TJvCustomDBTreeView.UpdateTree; ... oldRecCount := FDataLink.DataSet.RecordCount; end; This 3 strings can save sugnificant amount of time for user browsing BIG tree |
|
Fixed in CVS. |
Date Modified | Username | Field | Change |
---|---|---|---|
2005-04-27 02:31 | ivan_ra | New Issue | |
2005-05-18 05:50 | obones | Note Added: 0007181 | |
2005-05-18 05:50 | obones | Status | new => feedback |
2005-06-06 23:22 | ivan_ra | Note Added: 0007409 | |
2006-01-23 07:46 | ivan_ra | Note Added: 0008423 | |
2006-01-24 02:19 | AHUser | Status | feedback => resolved |
2006-01-24 02:19 | AHUser | Resolution | open => fixed |
2006-01-24 02:19 | AHUser | Assigned To | => AHUser |
2006-01-24 02:19 | AHUser | Note Added: 0008438 |