clarity filter does not work with multiple values - filter

Clarity Filter doesn't work with multiple values on random search
Please find an attachment
Filter Example
Regards,
Rupali Jain

The default built-in string filter is a simple string matcher, and that is explained in the documentation. For something more complex, you have to build this yourself with a custom filter. Often I have seen people build a custom filter with a list of checkboxes for the values in the field (such as none, data, etc) that can be applied in a search. See the custom filter documentation for details and demo of how to build your own.
https://v1.clarity.design/datagrid/custom-filtering

Related

How to comunicate available filter options to the frontend using Django REST framework / django filter?

We are running DRF in combination with django filter to narrow down list view results.
As filters and filter options are increasing, we would like the frontend to display only the available (the select-able) filter choices.
Simple example: There are a lot of products but none is green. The frontend should be able to disable/hide the checkbox for green by asking the DRF
More complex example: There are a lot of products and all of the red ones are small. If the user selected the red filter (e.g. frontend calls /products/?color=red) there is no need to bother the user with filters for medium and large.
Currently, we are about to create a custom implementation based on DRF's options method: That is manually checking for available filter choices depending on the current query set and returning this info as the "actions":{ "GET": {...}} dict using e.g. custom metadata.
We could also augment the GET response similar to the pagination API which already adds count, next and previous to the answer.
However, this seems to be a rather common use case (e.g. in online shops) and thus I was wondering if there is a django-filter/DRF-onic way (a best practice) or even a library for that.

Ag-Grid 'agSetColumnFilter' Customization

Can i change the default behaviour of agSetColumnFilter of ag-grid. I can change the filter values by using values: paramter in filterParams. But Since Set Filter performs exact serarch with cell Value so can i update it to Contains search instead of Exact Search.
Yes, you can do it. Under column definition.
{
filter: 'agSetColumnFilter',
filterParams: {
values: ["custom1", "custom2"]
}
Also read about [https://www.ag-grid.com/javascript-grid-server-side-model-filtering/#example-set-filter] to load the values Async.
No, that's not supported. The whole point of the agSetColumnFilter is to match a (hopefully) small set of values contained in a column. If you have so many different values that you need a 'contains' filter, then the setFilter is probably not appropriate anyway.
That said, if you want custom behavior in a filter, that is not accommodated by a standard filter your best is probably to write your own custom filter. The documentation for custom filters can be found at https://www.ag-grid.com/javascript-grid-filter-component/#custom-filter-example

Should specific filters be expressed as an explicitly named field, or a generic field with a filter param?

When expressing data filters, via GraphQL, should we be creating explicitly-named fields for that filter or should we be adding a parameter to a more generic list-type field that would apply the filter?
For example, if I've got a field called teams but I want to provide the ability to filter the data, provided by teams, down to only the teams who are active (versus inactive), should I expose that filter via GraphQL as a param on the teams field, or should I create a new field called activeTeams?
I'm thinking the clearly, explicitly named fields might scale better and be less confusing in the long run because there won't be questions about how params works when paired with each other, etc.
I wanted to get feedback on how maybe Facebook approaches this, or how others are doing so.
You should add the filter as a param on the teams field as this is the more scalable approach. Introducing a new filter means only a single parameter needs adding. Whereas the multiple-fields approach requires an exponential number of fields for each possible combination.
Don't forget that you can also alias fields on the client if you wish to fetch multiple queries of teams within the same component:
query on Viewer {
activeTeams: teams(active: true) { ... }
inactiveTeams: teams(active: false) { ... }
}

Is there a way to search for transactions by custom field?

I store specific custom field for each transaction. I'd like to conduct a search by this field. I wouldn't like to retrieve too many transactions (can filter by payment method id, but still) and iterate through them on application side. So, I read a documentation, didn't find an ability to search by custom field (only by predefined). I didn't try it out, but probably it's possibly to do so by following the same pattern like
var stream = gateway.transaction.search(function (search) {
search.myCustomField().is("custom_field_value");
// or search.customFields.myCustomField().is("custom_field_value");
});
Thanks in advance
I work as a developer for Braintree. Searching on custom fields is not supported at this time. You can see all of the searchable transaction attributes listed here.
If you would like to discuss alternatives, I recommend emailing our support team at support#braintreepayments.com to see if there is another method to achieve what you are trying to do.

Symfony2 validation filters

In my Symfony 2 application I need to filter input before passing it on to validation [1], however, I can't seem to find any system within Symfony to do this.
The type of filtering I looking for is e.g. to be able to filter a dash out of a specific field before validating it. E.g. users can enter 123-123 but the only accepted value is 123123. Just as I can set up validation rules with constraints, I'm looking for something similar for filters.
[1] http://symfony.com/doc/current/book/validation.html
Nifr's answer is good but is missing of an important alternative that, if I understand correctly your question, seems to fit perfectly your needs.
You can use a hook that is pretty much an event listener: if something happens or is going to happen, it intercepts the event and redirect it to your function.
In this case, you need a PRE_BIND hook (is deprecated since 2.3 version, now it's called PRE_SUBMIT)
Read this if you need help about
Either write your own Validation Assert to filter and then proxy the other validators for this purpose ...
... or one or multiple Regex Asserts.
... or use a DataTransformer to transform/filter the input.
With the DataTransformer involved you could aswell consider creating a new FieldType which renders two inputs with a seperator like the date form-field does. ( if not not used with widget => single_text )

Resources