?
avatar artur-stepien
artur-stepien
10 Sep 2015

Button clear filters for all views using this functionality will clear/reset only filters of type list. All the rest are untouched. It makes problem when you want to use text,calendar,checkbox fields as filters what can be very handy. Also there is another issue related to this. When you try to use checkbox type filter there will be no label (it is not rendered).

Steps to reproduce the issue

  • Go to administrator/components/com_content/models/forms/filter_articles.xml
  • add new field of type calendar with label Testing filters
  • go to Content/Articles
  • Select date from filter Testing filters
  • Now click on Clear button to the right of search phrase input.

Expected result

It should clear/reset all filter fields (also those of types like text etc)

Actual result

It resets only select/list fields

System information (as much as possible)

It will happen on all browsers and all system setups. It is caused by select selector in jQuery script called jquery.searchtools.js or jquery.searchtools.min.js

Additional comments

Fix should be easy for text,password,date,calendar fields but there are also bugs in template. When you add input selector in jquery.searchtools.js in getFilterFields, all fields of type text get active class what makes them green. This is a CSS bug in template (selector in template is to general - .active). So as you can see there are more problems in this and it affects few places. But it is required to fix it cause it blocks the building of advanced filters in components. Where radio fields can be swapped for list, calendar fields can't be swapped for anything else without losing usability. Fixing this should not have any impact on performance.

Sample custom filters

This is a custom filters that are reset when searchtools.js is fixed. As you can see they are green.
screen shot 2015-09-10 at 10 03 05

Votes

# of Users Experiencing Issue
1/1
Average Importance Score
3.00

avatar artur-stepien artur-stepien - open - 10 Sep 2015
avatar chmst
chmst - comment - 10 Sep 2015

I cannot reproduce this effect, all my filters are reset properly, but indeed I have no filters which use js as your calendar fields.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/7856.

avatar artur-stepien
artur-stepien - comment - 10 Sep 2015

Do you use Text type filters?

avatar chmst
chmst - comment - 10 Sep 2015

This kind of filters. I can enter text and choose all filters. Wiht a cklick on the button clear, they all are reset, including the text field

avatar artur-stepien
artur-stepien - comment - 10 Sep 2015

Searchword filter is not a custom text filter. All your custom filters are List type. I did specified how to reproduce.

avatar chmst
chmst - comment - 10 Sep 2015

you are right - sry - i had a confusion as I've a similiar problem.

avatar Bakual
Bakual - comment - 11 Sep 2015

I think you just need to use your own JavaScript there as it seems to be quite extension specific having such filters.

avatar artur-stepien
artur-stepien - comment - 11 Sep 2015

Yes I can use my own script in each component to fix the bug. But the functionality suggests it is universal. Why would you give the possibility to add filters in XML and then require your own reset JS functions? This is not developer friendly. The fix in jquery.searchtools.js is pretty easy. You just need to add few more form fields selectors in getFilterFields like for example input and textarea. But there are also administration template fixes that are required (just more specific CSS)

avatar artur-stepien
artur-stepien - comment - 11 Sep 2015

And yes. Those filters are all extension specific. This functionality is not for Joomla package extensions (but you should be able to use it in those too). This is for developers creating custom extensions. We want them to create more of them and as useful as it is possible. Right?

avatar Bakual
Bakual - comment - 11 Sep 2015

The fix in jquery.searchtools.js is pretty easy. You just need to add few more form fields selectors in getFilterFields like for example input and textarea.

Feel free to create a PR for those fixes and testing instructions. Then it can be tested, reviewed and merged.
See https://docs.joomla.org/Using_the_Github_UI_to_Make_Pull_Requests for how to do it.

avatar artur-stepien
artur-stepien - comment - 11 Sep 2015

I know how to make create it, not my first PR for joomla :) I'll try to create it this weekend.

avatar Bakual
Bakual - comment - 11 Sep 2015

Thanks :+1:

avatar brianteeman
brianteeman - comment - 10 Mar 2016

@artur-stepien did you manage to make a PR for this?


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/7856.

avatar brianteeman brianteeman - change - 10 Mar 2016
Category Administration Templates (admin) UI/UX Administration Fields Templates (admin) UI/UX
avatar artur-stepien
artur-stepien - comment - 10 Mar 2016

Have about 30% of this done. Got sick, give me few days.

avatar brianteeman
brianteeman - comment - 13 Apr 2016

@artur-stepien did you forget or are you still sick?


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/7856.

avatar artur-stepien
artur-stepien - comment - 13 Apr 2016

No, I'm like new but busy. Working on that one slowly. Ill try to finish it in a week.

avatar brianteeman
brianteeman - comment - 8 May 2016

Hi you created this issue sometime ago but have not yet provided any code for people to evaluate.I really dont want to just keep this open forever so I am closing this issue at this time. When you are ready to submit the Pull Request it will automatically create a new issue for you anyway.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/7856.

avatar brianteeman brianteeman - change - 8 May 2016
Status New Closed
Closed_Date 0000-00-00 00:00:00 2016-05-08 12:57:38
Closed_By brianteeman
avatar brianteeman brianteeman - close - 8 May 2016

Add a Comment

Login with GitHub to post a comment