Skip to Content Skip to Menu

Not exclusive search field in Userlist and sort priority

  • galanopd
  • galanopd
  • OFFLINE
  • Posts: 374
  • Thanks: 49
  • Karma: 8
2 years 8 months ago - 2 years 8 months ago #328516 by galanopd
I need an advice on the following, if it is doable

I have a field e.g. cb_religion, set in my list Parameters->Search together with other fields and I have also put that field to be the last in question as the other fields should have priority in search results.
I also have set cb_religion as last in list Sorting->Basic->cb_religion->Ascending

Now, if the user performs a search and sets cb_religion e.g. Hinduism, I need the search results to bring up Hinduism in a relative priority but not to exclude Buddhism, Muslim, Christianity, etc from appearing in the results.

Here is a Search example
Degree = Chemistry
Country = USA
State = Illinois
City = Springfield
Religion = Hinduism

In my results, I need exclusively to get Degree, Country, State, City but NOT exclusively Religion. Religion will appear only in priority among other religions.

Is that possible somehow?

Thanks
Last edit: 2 years 8 months ago by galanopd. Reason: Typo

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • OFFLINE
  • Posts: 48419
  • Thanks: 8274
  • Karma: 1443
2 years 8 months ago #328521 by krileon
There is no search sorting. So you can't perform a search and have it exclusively sort by the search criteria. Searching is exclusively filtering so it will reduce the result set. This means it will exclude any users that don't match the selected criteria. It's not possible from triggers either since the userlist query order by isn't exposed to any triggers.

You could set the search mode for your userlist to Advanced and this would let them select multiple values to search if they wanted.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • galanopd
  • galanopd
  • OFFLINE
  • Posts: 374
  • Thanks: 49
  • Karma: 8
2 years 8 months ago #328522 by galanopd
This would allow all users to be visible in case of "include any of" option is selected and it is something I need to prevent.
Moreover, it would slow down the search procedure but I understand your suggestion since there is no other way to perform this.

Is there at least a way to hide the "Find Users" (Submit) button unless all search fields are filled in order to narrow search results?

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • OFFLINE
  • Posts: 48419
  • Thanks: 8274
  • Karma: 1443
2 years 8 months ago #328527 by krileon

Is there at least a way to hide the "Find Users" (Submit) button unless all search fields are filled in order to narrow search results?

No, because such a requirement doesn't exist. They aren't required to fill out every search field. Best I can suggest is write some JS to hide the button if the other fields haven't been used. You should be able to output your custom JS to the userlist page on the onBeforeDisplayUsersList trigger using CB Auto Actions with a Code action. I cannot help you with writing the JS though, sorry.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
The following user(s) said Thank You: galanopd

Please Log in or Create an account to join the conversation.

  • galanopd
  • galanopd
  • OFFLINE
  • Posts: 374
  • Thanks: 49
  • Karma: 8
2 years 8 months ago - 2 years 8 months ago #328554 by galanopd
Ok, although the JS works fine in jsfiddle , I can't make it work using AutoActions.

Global->Triggers->OnBeforeDisplayUsersList
Action->Method->JQuery->Code->MyCode
The rest are default

I have tried almost everything and I also tried taking out the
Code:
(function() {})
but no luck. I see that it doesn't work because the
Code:
attr('disabled', 'disabled')
is not applied on "Find Users" (submit) button at all and I don't understand why...
Last edit: 2 years 8 months ago by galanopd.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • OFFLINE
  • Posts: 48419
  • Thanks: 8274
  • Karma: 1443
2 years 7 months ago #328563 by krileon

is not applied on "Find Users" (submit) button at all and I don't understand why...

You should use prop instead of attr when setting disabled state.

Enabled
Code:
element.prop( 'disabled', false );
Disabled
Code:
element.prop( 'disabled', true );

Open your browsers developer console by pressing F12 while testing to see if there's any JS errors going on. Please understand I cannot help you with custom coding.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum