data icon indicating copy to clipboard operation
data copied to clipboard

The Iterable filter is limited to one dimension

Open kamarton opened this issue 5 years ago • 3 comments

What steps will reproduce the problem?

Currently, the filtered value is treated as $item[$field]. I'm not really frontend developer, but I think yii2 knew it too: https://github.com/yiisoft/yii2/blob/f8611d170d77f8b89f24bd80e7f3b6b2a8947380/framework/grid/DataColumn.php#L232

What is the expected result?

Yii3 also uses <field>.<subfield> with ArrayHelper::getValue()

What do you get instead?

Currently not supported.

Additional info

in #28 issue also affect the implementation.

Q A
Version 1.0.0-under development
PHP version -
Operating system -

kamarton avatar Oct 12 '19 05:10 kamarton

I think there's no need to support that on data provider level. Having it at grid level should be enough.

samdark avatar Oct 13 '19 16:10 samdark

An interesting question, because basically you can avoid (eg. flatten, filter in browser with javascript). But I can imagine its use:

$data = StoreAR::find()->with('location')->where(..public..)->asArray()->all();  // eg counts less than 100
$cache->set('stores', $data);
// ...
$data = $cache->get('stores');
$reader = (new IterableDataReader($data))
   ->withFilters(new Like('location.city', $cityFilter));
// ...

kamarton avatar Oct 16 '19 03:10 kamarton

I'd postpone it till grids are implemented.

samdark avatar Oct 16 '19 08:10 samdark