- Posts: 78
- Thank you received: 2
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Extra heading row for array
- tixeon
- Topic Author
- Offline
- Senior Member
Less
More
3 years 10 months ago #200655
by tixeon
Extra heading row for array was created by tixeon
I had the following script to add an extra row in array questions in the past, but it is no longer working with the current version (3.22.17, professional hosted).
Essentially it is so that I have an extra row that looks like this (red part):
Any thoughts on how I can get it to work on the latest version?
Code:
<script type="text/javascript" charset="utf-8"> $(document).ready(function(){ // Identify this question var thisQuestion = $('#question{QID}'); // Insert the new header row $('table.subquestions-list thead', thisQuestion).prepend('<tr class="new-header">\ <td>&nbsp;</td>\ <th colspan="6" style="text-align:left;">Not satisfied at all</th>\ <th colspan="5" style="text-align:right;">Completely satisfied</th>\ <th></th>\ </tr>'); }); </script>
Essentially it is so that I have an extra row that looks like this (red part):
Any thoughts on how I can get it to work on the latest version?
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12888
- Thank you received: 3965
3 years 10 months ago #200659
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Extra heading row for array
Hi, tixeon,
Here is a script that runs in 3.22.x
I used the script provided here
forums.limesurvey.org/forum/can-i-do-thi...ngs-with-subheadings
You see there is only a small change in the first lines.
Joffm
but it is no longer working with the current version (3.22.17, professional hosted).
Here is a script that runs in 3.22.x
I used the script provided here
forums.limesurvey.org/forum/can-i-do-thi...ngs-with-subheadings
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="1"></td>\ <th colspan="6" style="text-align:left;">Not satisfied at all</th>\ <th colspan="5" style="text-align:right;">Completely satisfied</th>\ <td colspan="2"></td>\ </tr>'); }); </script>
You see there is only a small change in the first lines.
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Attachments:
The following user(s) said Thank You: tixeon
The topic has been locked.
- tixeon
- Topic Author
- Offline
- Senior Member
Less
More
- Posts: 78
- Thank you received: 2
3 years 10 months ago #200859
by tixeon
Replied by tixeon on topic Extra heading row for array
Brilliant, that works, thank you!
The topic has been locked.