Welcome to the LimeSurvey Community Forum

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

New Lime Version won't let me use the same script for array headings

  • Winocll_48635
  • Winocll_48635's Avatar Topic Author
  • Offline
  • Banned
  • Banned
More
4 years 4 months ago #190878 by Winocll_48635
so this script does work (though it doesn't get me exactly what i need)...
Code:
<script type="text/javascript" charset="utf-8">    
  $(document).on('ready pjax:scriptcomplete',function(){
 
    // IDENTIFY THIS QUESTION
    var thisQuestion = $('#question{QID}');
 
    // HIDE SUB-QUESTION
    $('.subquestions-list .col-responses .col-answers', thisQuestion).hide();
    $('.subquestions-list thead td', thisQuestion).hide();
    $('.subquestions-list .answertext', thisQuestion).hide();
    $('.subquestions-list col', thisQuestion).attr('width', (100/$('.subquestions-list col', thisQuestion).length)+'%');
 
    // ADD HEADER ROW
    $('table.subquestions-list thead', thisQuestion).prepend('<tr class="new-header">\
    <th colspan="11" style="text-align:left;">Poor<span style="float:right">Excellent</span></th>\
    </tr>');
  });
</script>

But this code doesn't work...
Code:
<script type="text/javascript" charset="utf-8">
 
  $(document).on('ready pjax:scriptcomplete',function(){
    // Insert the column categories
    $('#question{QID} table.subquestion-list thead tr:eq(0) td:eq(0)').remove();
    $('#question{QID} table.subquestion-list thead').prepend('<tr class="ls-heading">\
                                  <td rowspan="2" colspan="2"></td>\
                                  <th class="answer-text inserted-header" colspan="3">Dissatisfied</th>\
      <th class="answer-text inserted-header" colspan="5"> </th>\
                                  <th class="answer-text inserted-header" colspan="3">Very Satisfied</th>\
                                </tr>');
  });  
</script>
The topic has been locked.
  • Winocll_48635
  • Winocll_48635's Avatar Topic Author
  • Offline
  • Banned
  • Banned
More
4 years 4 months ago #190879 by Winocll_48635
The LSS file...

File Attachment:

File Name: limesurvey...1001.lss
File Size:222 KB
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 4 months ago #190902 by tpartner
Seriously? You provide a survey with 50 mandatory questions displayed question-by-question. Why are you making it so difficult for us to help you.

I say again, can you attach a small sample survey (.lss file) containing only that question?

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • Winocll_48635
  • Winocll_48635's Avatar Topic Author
  • Offline
  • Banned
  • Banned
More
4 years 4 months ago #190923 by Winocll_48635
The problem is with the script in the OP. In version 3 limesurvey apparently has different naming conventions for the calls.

I need help converting the OP script into a LimeSurvey version 3 compatible script. Anyone who can help with that i would greatly appreciate it.
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 4 months ago #190927 by Joffm
You still didn't say what you are going to achieve.

so this script does work (though it doesn't get me exactly what i need)...

What exactly do you like to get?

I did not find a question "OP".

But maybe this helps.

www.limesurvey.org/forum/can-i-do-this-w...rvey?start=15#186378

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: Winocll_48635
The topic has been locked.
  • Winocll_48635
  • Winocll_48635's Avatar Topic Author
  • Offline
  • Banned
  • Banned
More
4 years 4 months ago #191172 by Winocll_48635
That last post helped...the problem was that LimeSurvey version 2x used...
Code:
$(document).ready(function()


While version 3x uses...
Code:
$(document).on('ready pjax:scriptcomplete',function()
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 4 months ago #191199 by DenisChenu
It's due to ajax mode , in last version : it was totally disable …

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose