Jump to content

Grid filters List


UniterYazilim

Recommended Posts

  • 1 year later...

Yes, but it needs to be upgraded with text search box for values and limitation of menu subitems.

Also 'mark all' and 'unmark all' menu items.

In current state it is not really user friendly.

 

But still. Good job. And thanks for sharing.

  • Upvote 1
Link to comment
Share on other sites

  • 1 month later...

Please tell me. Why are there no filters in the grid?

thank you

procedure TfmMainForm.UniFormCreate(Sender: TObject);
begin
  CreateFilterDBGToday;
end;

procedure TfmMainForm.CreateFilterDBGToday;
var
  i:integer;
  FieldType: TFieldType;
  Column: TUniDBGridColumn;
begin
// dbgToday is a TUniDBGrid
  dbgToday.JSInterface.JSConfigPlugin('Ext.grid.filters.Filters', ['id', 'gridFilters']);

  for i := 0 to Pred(dbgToday.Columns.Count) do
  begin
    Column := dbgToday.Columns[i];
    Column.Filtering.Enabled := True;
    Column.Sortable := True;

    FieldType := dbgToday.DataSource.DataSet.FindField(Column.FieldName).DataType;

    case FieldType of
      ftString          : dbgToday.JSInterface.JSConfig('filter', ['string'], Column.JSColumn);
      ftDate, ftDateTime: dbgToday.JSInterface.JSConfig('filter', ['date'], Column.JSColumn);
      ftInteger, ftFloat: dbgToday.JSInterface.JSConfig('filter', ['number'], Column.JSColumn);
      ftBoolean         : dbgToday.JSInterface.JSConfig('filter', ['boolean'], Column.JSColumn);
      else
        dbgToday.JSInterface.JSConfig('filter', ['list'], Column.JSColumn);
    end;// case
  end;// for


//  Available values for Filter = "boolean,date,list,number,string"
// http://forums.unigui.com/index.php?/topic/11857-grid-filters-list/&do=findComment&comment=63164
end;

 

Screenshot_7.jpg

Link to comment
Share on other sites

  • 3 months later...
  • 1 month later...
  • 2 weeks later...
  • 6 months later...
On 10/1/2020 at 4:54 PM, x11 said:

Please tell me. Why are there no filters in the grid?

thank you

procedure TfmMainForm.UniFormCreate(Sender: TObject);
begin
  CreateFilterDBGToday;
end;

procedure TfmMainForm.CreateFilterDBGToday;
var
  i:integer;
  FieldType: TFieldType;
  Column: TUniDBGridColumn;
begin
// dbgToday is a TUniDBGrid
  dbgToday.JSInterface.JSConfigPlugin('Ext.grid.filters.Filters', ['id', 'gridFilters']);

  for i := 0 to Pred(dbgToday.Columns.Count) do
  begin
    Column := dbgToday.Columns[i];
    Column.Filtering.Enabled := True;
    Column.Sortable := True;

    FieldType := dbgToday.DataSource.DataSet.FindField(Column.FieldName).DataType;

    case FieldType of
      ftString          : dbgToday.JSInterface.JSConfig('filter', ['string'], Column.JSColumn);
      ftDate, ftDateTime: dbgToday.JSInterface.JSConfig('filter', ['date'], Column.JSColumn);
      ftInteger, ftFloat: dbgToday.JSInterface.JSConfig('filter', ['number'], Column.JSColumn);
      ftBoolean         : dbgToday.JSInterface.JSConfig('filter', ['boolean'], Column.JSColumn);
      else
        dbgToday.JSInterface.JSConfig('filter', ['list'], Column.JSColumn);
    end;// case
  end;// for


//  Available values for Filter = "boolean,date,list,number,string"
// http://forums.unigui.com/index.php?/topic/11857-grid-filters-list/&do=findComment&comment=63164
end;

 

Screenshot_7.jpg

Доброе время суток! Разобрались с этим вопросом? Меня в частности волнует локализация фраз Filters и прочие фразы?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...