- Posts: 136
- Thank you received: 4
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
array number fixed
- surveySn
- Topic Author
- Offline
- Premium Member
Less
More
3 years 4 months ago #208930
by surveySn
This script can fix a row at the end,
I want to fix 3 or 4 rows,How?
array number fixed was created by surveySn
Code:
<script type="text/javascript" charset="utf-8"> $(document).ready(function() { // The subquestion code to place in the last position var fixedCode = 'A8'; // Identify this question var q1ID = {QID}; var thisQuestion = $('#question'+q1ID); // Move the "fixed" row to the end $('table.subquestion-list tbody', thisQuestion).append($('tr[id$="X'+q1ID+fixedCode+'"]')); // Fix up the array row background colours $('tr.answers-list', thisQuestion).each(function(i){ $(this).removeClass('array1 array2').addClass('array'+(2-(i%2))); }); }); </script>
This script can fix a row at the end,
I want to fix 3 or 4 rows,How?
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10099
- Thank you received: 3589
3 years 4 months ago #208946
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic array number fixed
Sample survey?
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- surveySn
- Topic Author
- Offline
- Premium Member
Less
More
- Posts: 136
- Thank you received: 4
3 years 4 months ago #208957
by surveySn
Replied by surveySn on topic array number fixed
I want y-scale 8, 9, 10 to be fixed at the end.
Thank you for your response,
Thank you for your response,
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10099
- Thank you received: 3589
3 years 4 months ago #208970
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic array number fixed
Code:
<script type="text/javascript" charset="utf-8"> $(document).ready(function() { // The subquestion codes to place in the last position var fixedCodes = ['8', '9', '10']; // Identify this question var q1ID = {QID}; var thisQuestion = $('#question'+q1ID); // Move the "fixed" rows to the end $.each(fixedCodes, function(i, code) { $('table.subquestion-list tbody:last', thisQuestion).append($('tr[id$="X'+q1ID+code+'"]')); }); // Fix up the array row background colours $('tr.answers-list', thisQuestion).each(function(i){ $(this).removeClass('array1 array2').addClass('array'+(2-(i%2))); }); }); </script>
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- surveySn
- Topic Author
- Offline
- Premium Member
Less
More
- Posts: 136
- Thank you received: 4
3 years 4 months ago #208980
by surveySn
Replied by surveySn on topic array number fixed
Cool, thank you, Tony,
The topic has been locked.