RxFPC:fix RxDBGrid sort engine for TkbmMemTable - part 2
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@9417 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
parent
bfea9520e9
commit
ecd99feedb
@ -45,7 +45,7 @@ type
|
||||
protected
|
||||
public
|
||||
procedure Sort(FieldName: string; ADataSet:TDataSet; Asc:boolean; SortOptions:TRxSortEngineOptions);override;
|
||||
// procedure SortList(ListField:string; ADataSet:TDataSet; Asc: array of boolean; SortOptions: TRxSortEngineOptions);override;
|
||||
procedure SortList(ListField:string; ADataSet:TDataSet; Asc: array of boolean; SortOptions: TRxSortEngineOptions);override;
|
||||
end;
|
||||
|
||||
|
||||
@ -65,17 +65,42 @@ begin
|
||||
if Assigned(ADataSet) then
|
||||
(ADataSet as TkbmMemTable).SortOn(FieldName, D);
|
||||
end;
|
||||
{
|
||||
|
||||
procedure TKBMMemTableSortEngine.SortList(ListField: string;
|
||||
ADataSet: TDataSet; Asc: array of boolean; SortOptions: TRxSortEngineOptions);
|
||||
var
|
||||
S: String;
|
||||
C: SizeInt;
|
||||
i: Integer;
|
||||
begin
|
||||
D:=[];
|
||||
if not Asc then
|
||||
D:=D + [mtcoDescending];
|
||||
if Assigned(ADataSet) then
|
||||
(ADataSet as TkbmMemTable).SortFields(ListField, Asc);
|
||||
if not Assigned(ADataSet) then exit;
|
||||
|
||||
S:='';
|
||||
C:=Pos(';', ListField);
|
||||
i:=0;
|
||||
while C>0 do
|
||||
begin
|
||||
if S<>'' then S:=S+';';
|
||||
S:=S + {FixFieldName(}Copy(ListField, 1, C-1){)};
|
||||
Delete(ListField, 1, C);
|
||||
|
||||
if (i<=High(Asc)) and (not Asc[i]) then
|
||||
S:=S + ':D';
|
||||
C:=Pos(';', ListField);
|
||||
inc(i);
|
||||
end;
|
||||
|
||||
if ListField<>'' then
|
||||
begin
|
||||
if S<>'' then S:=S+';';
|
||||
S:=S + {FixFieldName(}ListField{)};
|
||||
if (i<=High(Asc)) and (not Asc[i]) then
|
||||
S:=S + ':D';
|
||||
end;
|
||||
|
||||
(ADataSet as TkbmMemTable).SortOn(S, [mtcoCaseInsensitive]);
|
||||
end;
|
||||
}
|
||||
|
||||
|
||||
initialization
|
||||
RegisterRxDBGridSortEngine(TKBMMemTableSortEngine, 'TkbmMemTable');
|
||||
|
Loading…
Reference in New Issue
Block a user