View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0006115 | JEDI VCL | 00 JVCL Components | public | 2013-04-03 10:49 | 2014-01-29 09:58 |
Reporter | SF | Assigned To | |||
Priority | normal | Severity | minor | Reproducibility | always |
Status | acknowledged | Resolution | open | ||
Product Version | 3.47 | ||||
Target Version | Fixed in Version | ||||
Summary | 0006115: AutoSort in JvDBUltimGrid | ||||
Description | Autosort of ClientDataSet, by clicking title (button), always creates a new index (_Idx_1, _Idx_2 etc)instead of re-using the same again (procedure = SetClientIndex). As far as I can see, this could solve this issue: procedure SetClientIndex(SortField: TField); const cIndexPrefix = '_Idx_'; var IndexDefs: TIndexDefs; I: Integer; NewIndexName: string; begin IndexDefs := TIndexDefs(GetOrdProp(DSet, cIndexDefs)); // Start change 1 (remark of the next line) // IndexDefs.Update; It seems like "Update" clears the "IndexDefs.Items[I].DescFields" out = always empty. // End change 1 { Search for an existing index... } for I := 0 to IndexDefs.Count - 1 do begin if (Pos(cIndexPrefix, IndexDefs.Items[I].Name) = 1) and // Search among the indexes this procedure creates by itselt. (AnsiSameText(SortString, IndexDefs.Items[I].Fields)) and (AnsiSameText(DescString, IndexDefs.Items[I].DescFields)) then begin NewIndexName := IndexDefs.Items[I].Name; UpdateProp(cIndexName, NewIndexName, SortField); Break; end end; { ... or else create a new one } // Start change 2 if I = IndexDefs.Count then begin // End change 2 Inc(FIndexCounter); NewIndexName := cIndexPrefix + IntToStr(FIndexCounter{IndexDefs.Count}); with IndexDefs.AddIndexDef do begin Name := NewIndexName; Fields := SortString; CaseInsFields := SortString; DescFields := DescString; end; UpdateProp(cIndexName, NewIndexName, SortField); // Start change 3 end; // End change 3 end; | ||||
Tags | No tags attached. | ||||
|
Please try with the latest JVCL version in GIT (or daily zip) and then send us a zipped file containing the sources of an application showing the issue. |
2014-01-16 16:58
|
0006115.zip (82,776 bytes) |
|
Attach is an application displaying this issue! |