I created a new entity and trying to allow admins to crud the entity through admin controller. I suspect I will have over 300 of these entities so using the filter_macros in the template to allow admin to filter by string.
So when using this without the "prefix" checked, the datalist gets updated properly with the filtered list.
However when I have prefix checked, the datalist doesn't show anything. Using chrome tools, I can see that the browser is making an ajax call and it looks like it's fetching the proper response with the items however this does not show up in the datalist.
In the backend, I'm using finder and whereOr with prefixMatch condition:
I've looked at examples of this in phrase_list and template_list and so on and still can't figure out why this isn't working for my entity.
Any help would be appreciated.
thanks!
So when using this without the "prefix" checked, the datalist gets updated properly with the filtered list.
However when I have prefix checked, the datalist doesn't show anything. Using chrome tools, I can see that the browser is making an ajax call and it looks like it's fetching the proper response with the items however this does not show up in the datalist.
PHP:
<xf:macro template="filter_macros" name="quick_filter"
arg-key="entity"
arg-ajax="{{ link('myaddon/entity') }}"
arg-class="block-outer-opposite" />
In the backend, I'm using finder and whereOr with prefixMatch condition:
PHP:
public function searchEnt($match, $prefixMatch = false)
{
if (strlen($match))
{
$this->whereOr(
[
$this->columnUtf8('ent_name'),
'LIKE',
$this->escapeLike($match, $prefixMatch ? '?%' : '%?%')
],
[
$this->columnUtf8('ent_abbr'),
'LIKE',
$this->escapeLike($match, $prefixMatch ? '?%' : '%?%')
]
);
}
return $this;
}
I've looked at examples of this in phrase_list and template_list and so on and still can't figure out why this isn't working for my entity.
Any help would be appreciated.
thanks!
Last edited: