Comments (7)
That is correct. I found no easy way to implement that because how filter is applied differs per data reader implementation. In array reader that's directly checking an item, in SQL reader that's forming a query.
If you have idea on how to implement it, I'd love to hear it.
from data.
In this form, it severely limits the opportunity. Simply put, I know I use ArrayDataProvder
or ActiveDataProvider
, so why can't I add my own custom filter.
At worst, the filter you create is limited to some DataProviders.
Suggest: different data providers need to define separate interfaces, and if you define it on a filter, you can use it.
In this case, e.g. the regexp filter:
- define function for
ArrayDataProvider
:preg_match(...)
- define function for
ActiveDataProvider
:new Expression('REGEXP ...')
- not define function for
XxxxxDataProvider
: throw exceptionnot supported filter
.
from data.
I want to build GridView on top of this package and it should not be aware which data provider is used and rely on interface.
from data.
GridView also has to work with Filter classes, I see no reason to define a GridView custom ColumnFilter, which can also be defined by Custom Filter.
I will think about this problem, but I think there is something wrong between the layers if you don't allow it.
from data.
Yes, I'd like to allow it as well. Just had no immediate idea on how to do it best.
from data.
Although I was thinking of a similar solution, I feel a bit hurried about the topic. It is true that it is currently applicable on its own at this layer, but as the upper layers enter, it may not be the right solution at all. It seems to be a detour rather than a layered approach.
from data.
This one is solved now. PR is to be merged soon.
from data.
Related Issues (20)
- Add `iterable` support in `DataProcessorInterface` HOT 1
- Paginator refactoring concept HOT 2
- Remove `PaginatorInterface` HOT 2
- Increase test coverage to 100%
- Rename filter processor to handler
- Improve namespacing HOT 1
- Move `FilterDataValidationHelper::assertFilterHandlerIsIterable()` method to `Iterable` namespace HOT 2
- Allow pass criteria array to `Group` (reader) filter constructor HOT 1
- Throws exception when pass to `IterableDataReader` non-`IterableFilterHandlerInterface` filter handlers HOT 2
- Make accessing item methods explicit or not? HOT 2
- Add suffix `Handler` for all filter handlers HOT 1
- Finalize `IterableDataReader` HOT 4
- Rename `withFilterHandlers()` to `withAddedFilterHandlers()` into `FilterableDataInterface`
- Remove scrutinizer
- Class Yiisoft\Yii\Cycle\Data\Reader\FilterHandler\AllHandler contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Yiisoft\Data\Reader\FilterHandlerInterface::getFilterClass) HOT 3
- update irc link
- Reuse tests for all data packages
- Add `ILike` filter
- Find a test case with multibyte strings for `Like` and `ILike` filter handlers
- Do not preserve keys of filtered items in iterable data reader HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from data.