Download the PHP package silverstripe-terraformers/gridfield-rich-filter-header without Composer

On this page you can find all versions of the php package silverstripe-terraformers/gridfield-rich-filter-header. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package gridfield-rich-filter-header

GridField rich filter header

Latest Stable Version Total Downloads Latest Unstable Version License PHP Version Require

This GridField component is intended to replace the default GridFieldFilterHeader component and provide rich functionality not available in the original.

Here is a brief comparison of these components:

GridFieldFilterHeader (original component)

RichFilterHeader (component in this module)

Overall this module allows you to fully customise your GridField filters including rare edge cases and special requirements.

Requirements

Installation

composer require silverstripe-terraformers/gridfield-rich-filter-header

Basic configuration

Full filter configuration format looks like this:

Concrete example:

search_filter_type can be any SearchFilter, see search filter documentation for more information

https://docs.silverstripe.org/en/4/developer_guides/model/searchfilters/

Shorter configuration formats are available as well:

Field mapping version doesn't include filter specification and will use PartialMatchFilter. This should be used if you are happy with using PartialMatchFilter

Whitelist version doesn't include filter specification nor field mapping. This configuration will use PartialMatchFilter and will assume that both GridField_column_name and DB_column_name are the same.

Multiple filters configuration example:

If no configuration is provided via setFilterConfig method, filter configuration will fall back to searchable_fields of the DataObject that is listed in the GridField. If searchable_fields configuration is not available, summary_fields will be used instead.

Make sure you add the RichFilterHeader component BEFORE the GridFieldPaginator otherwise your pagination will be broken since you always want to filter before paginating. Sort header component also needs to be replaced to allow the filter expand button to be shown.

Field configuration

Any FormField can be used for filtering. You just need to add it to filter configuration like this:

Name of the field can be left empty as it is populated automatically. I recommend to leave the title empty as well as you probably don't need to display it as it is redundant to GridField column header title in most cases.

Filter methods

This configuration covers most edge cases and special requirements where standard SearchFilter is not enough. If filter method is specified for a field, it will override the standard filter. Filter method is a callback which will be applied to the DataList and you are free to add any functionality you need inside the callback. Make sure that your callback returns a DataList with the same DataClass as the original.

Note that $name will have the value of DB_column_name from your config.

For your convenience there are couple of filter methods available to cover some cases.

Both of these filters can be used in setFilterMethods like this:

Additional examples

Example #1

Example #2

Note that the items that are listed in the GridField have a many_many relation with TaxonomyTerm called TaxonomyTerms

Example #3

Our custom filter method filters records by three different DB columns via PartialMatch filter.

Example #4

This example covers

We can now filter players by teams.


All versions of gridfield-rich-filter-header with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
silverstripe/cms Version ^5
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package silverstripe-terraformers/gridfield-rich-filter-header contains the following files

Loading the files please wait ....