For a component view create a filter form without a field with name search.
Works OK with the other filter fields.
Get Javascript error Uncaught TypeError: this.searchField is null on line 105 of searchttols.js
One way round this is to create a hidden filter field named search.
<field name="search1" type="hidden" disabled="disabled" />
Better way would be to change the line in searchtools.js to allow for this situation.
if (this.searchField) {
this.searchString = this.searchField.value; // Do some binding
}
Labels |
Removed:
?
|
Labels |
Added:
No Code Attached Yet
|
Using a custom layout ...
<?php
echo LayoutHelper::render('searchtools.custom', array('view' => $this));
?>
Did not want to touch the Javascript.
Okay, understood. I will make js fix a bit later.
Or you can do PR, as you already have a fix
this.searchString = this.searchField ? this.searchField.value : '';
I have changed this, can I do PR
Yes you can do the PR thanks, not setup for it at the moment - just tested the line from Fedik on a demo site.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2021-12-17 13:58:30 |
Closed_By | ⇒ | Fedik |
One more thing, if a filter form does not contain "search" field, then whole search is not rendered, or I am wrong?
I just tried to test on
administrator/components/com_content/forms/filter_articles.xml
, and when I rename/removesearch
field then whole filter disappeares.js error can be fixed easily, but the filter will not be shown anyway.
I not sure if it a bug or feature :)