[patch_done] sorting after post

Code patches written by our users to solve certain "problems" that were not solved, yet.

Moderators: gto, cipto_kh, EgonHugeist, mdaems

Post Reply
karpik
Fresh Boarder
Fresh Boarder
Posts: 4
Joined: 25.07.2008, 14:04

[patch_done] sorting after post

Post by karpik »

Hi all,
this is my first zeos hack
it is simple but this is the only way i can do this (hacking zeoslib)

After Post zeos allways do sorting (if SortedFields is filled).
With TDBGrid this is not ideal behavior - bad performance, and sequence of records is changed if sorted field changing...

After this little patch there is another option doDontSortOnPost

in ZAbstractRODataset.pas

Code: Select all

  {** Options for dataset. }
  TZDatasetOption = (doOemTranslate, doCalcDefaults, doAlwaysDetailResync,
    doSmartOpen, doDontSortOnPost);
in ZAbstractDataset.pas

Code: Select all


procedure TZAbstractDataset.InternalPost;

(...)

    {BUG-FIX: bangfauzan addition}
    if (SortedFields<>'') and not (doDontSortOnPost in Options)  then begin
      FreeFieldBuffers;
      SetState(dsBrowse);
      Resync([]);

(...)
regards
Karpik

PS Sorry for bad english
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

Committed your patch to testing branch. (SVN rev. 407)

Mark
Image
Post Reply