Ehlib

XXProger

Member
Joined
Feb 22, 2010
Messages
13
Reaction score
1
Народ подскажите в EHGrid как инвертацию сортировки сделать без правки исходников, может какие-то настройки есть?
 

Freezer_86

Member
Joined
May 6, 2011
Messages
20
Reaction score
5
Народ подскажите в EHGrid как инвертацию сортировки сделать без правки исходников, может какие-то настройки есть?
Что значит "инвертацию сортировки"?? Отсортировать в другую сторону? Или поменять иконки местами?
 

Freezer_86

Member
Joined
May 6, 2011
Messages
20
Reaction score
5
Я сделал свой класс на основе TDBGridEh, и добавил процедурку:
Code:
procedure TKDBGridEx.SortColumn(aColumn: TColumnEh;
  aSortMarker: TSortMarkerEh; MultiSort: boolean);
//var i : integer;

  procedure ClearColSorting;
  var
    i : integer;
  begin
    if not (MultiSort) then begin
      //если мультисортировка не разрешена - снимаем сортировку со всех колонок
      for I := 0 to Columns.Count - 1 do
        if (Columns[i].Title.SortMarker <> smNoneEh) then
          Columns[i].Title.SortMarker := smNoneEh;
    end;
  end;

begin

  if aColumn.Title.SortMarker <> smNoneEh then begin
   //если колонка отсортирована
    if ((aSortMarker = smUpEh) and ( aColumn.Title.SortMarker = smUpEh))
     or((aSortMarker = smDownEh) and ( aColumn.Title.SortMarker = smDownEh))
    then begin
      //если направление сортировки и клавиша совпадают
      ClearColSorting;
      DoSortMarkingChanged;
      exit;
    end else begin
      ClearColSorting;
      aColumn.Title.SortMarker := aSortMarker;
      DoSortMarkingChanged;
      exit;
    end;
  end else begin
   //если колонка еще не отсортирована
    ClearColSorting;

    aColumn.Title.SortMarker := aSortMarker;
    DoSortMarkingChanged;
    exit;
  end;
end;

Весь код компонента не выкладываю, но принцип должен быть понятен
 

XXProger

Member
Joined
Feb 22, 2010
Messages
13
Reaction score
1
Я сделал свой класс на основе TDBGridEh, и добавил процедурку:
Code:
procedure TKDBGridEx.SortColumn(aColumn: TColumnEh;
  aSortMarker: TSortMarkerEh; MultiSort: boolean);
//var i : integer;

  procedure ClearColSorting;
  var
    i : integer;
  begin
    if not (MultiSort) then begin
      //если мультисортировка не разрешена - снимаем сортировку со всех колонок
      for I := 0 to Columns.Count - 1 do
        if (Columns[i].Title.SortMarker <> smNoneEh) then
          Columns[i].Title.SortMarker := smNoneEh;
    end;
  end;

begin

  if aColumn.Title.SortMarker <> smNoneEh then begin
   //если колонка отсортирована
    if ((aSortMarker = smUpEh) and ( aColumn.Title.SortMarker = smUpEh))
     or((aSortMarker = smDownEh) and ( aColumn.Title.SortMarker = smDownEh))
    then begin
      //если направление сортировки и клавиша совпадают
      ClearColSorting;
      DoSortMarkingChanged;
      exit;
    end else begin
      ClearColSorting;
      aColumn.Title.SortMarker := aSortMarker;
      DoSortMarkingChanged;
      exit;
    end;
  end else begin
   //если колонка еще не отсортирована
    ClearColSorting;

    aColumn.Title.SortMarker := aSortMarker;
    DoSortMarkingChanged;
    exit;
  end;
end;

Весь код компонента не выкладываю, но принцип должен быть понятен

как вариант, но я обычно правлю исходник... правда при обновлении компонент приходится заново все вносить =)
 

alexray79

Member
Joined
Jan 25, 2009
Messages
14
Reaction score
0
Подскажите, пожалуйста, как подружить Ehlib и Absolute Database, чтобы работала сортировка и фильтрация как в TMemTableEh?
 

emailx45

Social Engineer
Joined
May 5, 2008
Messages
2,388
Reaction score
2,149
http://www.ehlib.com/en/list-of-components-and-classes

TMemTableEh
TMemTableEh - dataset, which hold data in memory. Its possible consider as an array of records.

Besides, it:
  • Supports a special interface, which allows DBGridEh component to view all data without moving active record.
  • Allows fetch data from TDataDriverEh object (DataDriver property).
  • Allows unload change back in DataDriver, operative or postponed (in dependencies of the CachedUpdates property).
  • Allows to create a master/detail relations on the client (filtering record) or on the external source (updating parameters [Params] and requiring data from DataDriver).
  • Allows once-only (without the dynamic support) sort data, including Calculated and Lookup field.
  • Allows create and fill data in design-time and save data in dfm file of the Form.
  • Allows keep record in the manner of trees. Each record can have record elements-branches and itself be an element to other parental record. Component TDBGridEh supports to show the tree-type structure of these records.
  • Allows to connect to the internal array of other TMemTableEh (via ExternalMemData property) and work with its data: sort, filter, edit.
  • Has interface for requesting list of all unique values in one column of records array, ignoring local filter of the DataSet. TDBGridEh uses this property for automatic filling a list in DropDownBox of the subtitle filter cell.
 

alexray79

Member
Joined
Jan 25, 2009
Messages
14
Reaction score
0
Спасибо, это немного не то, что я хотел узнать.
 

S_Gur

Social Engineer
Joined
Feb 26, 2007
Messages
39
Reaction score
6
Господа, никто не юзал EhLib под Lazarus? В TPropStorageEh не работает редактор сохраняемых свойств. Есть какие-то решения проблемы?
 

Asimiv64

New member
Joined
Sep 2, 2017
Messages
4
Reaction score
0
"Hey guys, never heard of Ehlib, has anyone got some info on this project? Looks like a new DeFi play, but can't find much about their roadmap or team. Anyone in the know?"
 
Joined
Feb 11, 2011
Messages
6
Reaction score
0
"Yo, I was checking out Ehlib and it seems like they're trying to bring some serious innovation to the DeFi scene. The fact that they're working with a new consensus algorithm is super interesting - got any updates on its potential performance?"
 

Yavorskii

Member
Joined
Dec 9, 2011
Messages
6
Reaction score
0
"Hey guys, saw this mention of Ehlib for the first time, anyone know what it's about? Trying to research it but can't seem to find much info, could you share some insights if you have any?"
 
Top