=======
Filters
=======

For each item that have access to a database table a list of filter objects can 
be created.

To create filters use 
an :doc:`Filters Dialog </admin/items/filters_dialog>` of the Administrator

Filters provide a convenient way for users to visually specify parameters of 
request made by the application to the project database, see 
:doc:`Working with filters </programming/interface/working_with_filters>`
in the 
:doc:`Client side programming </programming/interface/index>`


Each filter has the following attributes:

* ``owner`` – an item that owners this filter,
* ``filter_name`` — the name of the filter that can be used in programming code
* ``filter_caption`` - the name of the filter used in the visual representation 
  in the client application,
* ``filter_type`` — type of the filter, see 
  :doc:`Filtering records <filtering_records>`,
* ``visible`` — if the value of this attribute is ``true``, a visual 
  representation of this filter will be created by the 
  :doc:`create_filter_inputs </refs/client/item/m_create_filter_inputs>`
  method, when a ``filters`` option is not specified,
* value — a value of the filter,

All filters of the item are attributes of the ``filters`` of its object.
By using ``filter_name`` we can get access to the filter object:

.. code-block:: js

    invoices.filters.invoicedate1.value = new Date()

Another way to get access to the filter is to use
:doc:`filter_by_name </refs/client/item/m_filter_by_name>`
method:

.. code-block:: js

    invoices.filter_by_name('invoicedate').value = new Date()


See also
========

:doc:`Dataset <dataset>`

:doc:`Filtering records <filtering_records>`

:doc:`Working with filters </programming/interface/working_with_filters>`

Client
------

:doc:`filters </refs/client/item/at_filters>`

:doc:`Filter class </refs/client/filter_api>`

:doc:`assign_filters </refs/client/item/m_assign_filters>`

:doc:`clear_filters </refs/client/item/m_clear_filters>`

:doc:`each_filter </refs/client/item/m_each_filter>`

:doc:`filter_by_name </refs/client/item/m_filter_by_name>`

Server
------

:doc:`filters </refs/server/item/at_filters>`

:doc:`Filter class </refs/server/filter_api>`

:doc:`clear_filters </refs/server/item/m_clear_filters>`

:doc:`filter_by_name </refs/server/item/m_filter_by_name>`
