Skip Navigation

[Resolved] Select2 automatically loading random results on click instead of default message

This support ticket is created 4 years, 1 month 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
9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 - - 9:00 – 13:00
14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 - - 14:00 – 18:00

Supporter timezone: Africa/Casablanca (GMT+01:00)

This topic contains 5 replies, has 2 voices.

Last updated by Jamal 4 years ago.

Assisted by: Jamal.

Author
Posts
#1813163
Untitled-1.jpg

I am trying to: Use select2 to query 400+ posts of a relationship field. (the parent)

Link to a page where the issue can be seen:

I expected to see: Upon clicking the search box, Select2 should show "please enter 1 or more characters" or similar message.

Instead, I got: The dropdown displays 10 posts and I have no idea what order they are in or why they are the default posts. It should show the message as you see on their own info page: hidden link

It's much easier for the user to not see random un-related options and just begin typing what they wish to see.

thanks!

marc

#1813723

Hello Marc and thank you for contacting the Toolset support.

I assume that you are talking about the select2 in a Toolset Post form, right?
Currently, a parent post field, in a Toolset form will trigger an AJAX call to get values as soon as we click on it. But, it still offers an input to enter text and to search for parent posts against it. Check this screenshot hidden link
The values returned by the AJAX call can be ordered with the Title, ID, or date. They can also be scoped to the current user. Check this screenshot of such a field hidden link

If you believe that the select2 field should not trigger the AJAX call until the user enters some characters, let me know and I'll file it as a feature request.

#1814283

Hi,

Unfortunately, it appears all of the options are being ignored. I've tried all the various query and sorting options but the result is always the same.

[cred_field field='@condition-report.parent' class='condition-select2' select_text='Begin typing...' required='true' ordering='desc']

If I could at least see them alphabetically it would make more sense, otherwise I would prefer to request the feature of not showing any results and having people type something first.

thanks

#1814341

After further testing, I was finally able to get some sorting of the initial results. The default is to sort by ID "descending" so I forced sort by ID and "ascending" and that works.

I would still love to see the feature of showing nothing initially.

thanks

marc

#1816529

Let me approach our 2nd tier to check if we can file this as a feature request and get back to you.

#1817357

The request has been submitted and will be evaluated by the developers to see when it can be implemented.

Thank you for your suggestion.