Have an idea?

Visit Sawtooth Software Feedback to share your ideas on how we can improve our products.

Repeat column labels for one specific row in a grid

I know I can check the box that will repeat column labels ever "x" rows, but is there some script to repeat the corner label and column labels for just one specific row?
asked Mar 12, 2019 by Jay Rutherford Gold (37,685 points)

1 Answer

0 votes
Best answer
This script will repeat the column header row above the third row item:

    $('#[% QuestionName() %]_r3_row').before($('#[% QuestionName() %]_div .column_header_row:first-child').clone());
    $('#[% QuestionName() %]_div .inner_table > tbody > tr:even > td').removeClass('alt_color2').addClass('alt_color1');
    $('#[% QuestionName() %]_div .inner_table > tbody > tr:odd > td').removeClass('alt_color1').addClass('alt_color2');

I have assumed the grid's alternating color direction is set to rows.
answered Mar 12, 2019 by Zachary Platinum Sawtooth Software, Inc. (153,100 points)
selected Mar 12, 2019 by Jay Rutherford
Well I have an odd thing happening.  If I click preview for that question it shows and works, however, when I test in a browser and skip to that question it doesn't show up at all.  I even uploaded and tried that way and it still didn't show up.
Ahh, never mind, it was me.  It's a constructed list and I was setting it for the wrong row number.  It looks to be working as it should.  Sorry and thanks again!