Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

survey permission

  • limevives
  • limevives's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 months 30 minutes ago #250731 by limevives
survey permission was created by limevives
Please help us help you and fill where relevant:
Your LimeSurvey version: 5.6.35
Own server or LimeSurvey hosting: Own server
Survey theme/template: 
==================
Hello! How can I sort users by name in survey permission>add user 
See my attachment

thanks
https://imgtr.ee/image/limesurvey.R1pTj 

Please Log in to join the conversation.

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 months 4 weeks ago #250752 by tpartner
Replied by tpartner on topic survey permission
Create a custom admin theme and add a custom.js file to that theme - manual.limesurvey.org/Custom_Admin_Theme...eating_a_new_theme_3

Place this in that custom.js file:
 
 
Code:
function sortSelect(thisSelect, firstOptSticky) {
  var selectOptions = $('option', thisSelect);
  if(firstOptSticky) {
    selectOptions = $('option:not(:first)', thisSelect);
  }
 
  selectOptions.detach().sort(function(a, b) {
    var at = $(a).text();
    var bt = $(b).text();
    return (at > bt) ? 1 : ((at < bt) ? -1 : 0);
  });
  selectOptions.appendTo(thisSelect);
}
 
 
$(document).on('ready pjax:scriptcomplete',function(){
 
  if($('#uidselect').length > 0) {    
    sortSelect($('#uidselect'), true);
  }
 
});

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

  • limevives
  • limevives's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 months 3 weeks ago #250860 by limevives
Replied by limevives on topic survey permission
Dear,
Thank you very very much! It works!!
If I want to sort by 'full name' what I need to change?

Best regards
Rustam

Please Log in to join the conversation.

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 months 3 weeks ago #250862 by tpartner
Replied by tpartner on topic survey permission
Without hacking the core code, you can only sort by the values provided by LimeSurvey in the list.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

  • limevives
  • limevives's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 months 3 weeks ago #250863 by limevives
Replied by limevives on topic survey permission
I mean what I have to write instead #uidselect to sort by 'full name'?

Please Log in to join the conversation.

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 months 3 weeks ago #250864 by tpartner
Replied by tpartner on topic survey permission
#uidselect is a selector for that dropdown. There is no dropdown containing only full names.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

  • limevives
  • limevives's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
6 months 3 weeks ago #250865 by limevives
Replied by limevives on topic survey permission
ok, thanks

Please Log in to join the conversation.

Lime-years ahead

Online-surveys for every purse and purpose