Skip Navigation

[Resolved] Ajax filter update is not working fine.

This support ticket is created 3 years, 9 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

Tagged: 

This topic contains 4 replies, has 2 voices.

Last updated by Himanshu Agarwal 3 years, 9 months ago.

Assigned support staff: Nigel.

Author
Posts
#1237577

HI,
We are using filter result by ajax in site, but when we frequently change the category in filter, that selected category is removed and showing all result without filter.

You can check this on hidden link

Please help me to solve this that filter work correctly.

#1237731

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi there

I've been visiting your search page and trying to break it, but haven't been able to so far.

The only issue that I can see, that is largely unavoidable, is that if you click several categories very quickly one after another—e.g. click education, entertainment, and finance very quickly—then some of the checked categories can become unchecked.

That's because your settings are to update the results as soon as any filter value is changed, so clicking a category creates an ajax request to update the results, which also replaces the filter control section, too, and so if you click a second category before the results of the first click are returned your second click might be lost.

I'm not sure if that is the problem you are describing, or whether you mean something else.

If that were the case you would need to resolve it by changing the settings so that results update via ajax, but only after clicking the submit button.

#1237743

Thank You Nigel,
As you said:
"That's because your settings are to update the results as soon as any filter value is changed, so clicking a category creates an ajax request to update the results, which also replaces the filter control section, too, and so if you click a second category before the results of the first click are returned your second click might be lost."

Exactly this is happening. Is there any way to prevent this?

#1237759

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Screenshot 2019-04-30 at 14.19.56.png

You might see an improvement if you change the settings for the View.

The screenshot shows what I think you currently have. If you change it to "Always show all values for inputs" that might help.

But if you see the same, then the only alternative is to change the settings so that they update only with a submit button (even though the results themselves can update via ajax).

#1238455

Thank you!