Have an idea?

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

How to saperate other specify in grid question

Dear All,

I want to create a grid question like the link below. How can I do that?

https://drive.google.com/file/d/10TI8sS0j18QpEVACuoIqmTTtn-K6CC8B/view?usp=sharing

Thanks,
asked Dec 9, 2021 by Saroeun Bronze (2,995 points)
Is using a row-oriented grid question acceptable for you?
we're using column grid question. Please help to fix.

1 Answer

0 votes
 
Best answer
I would start by creating two column-oriented grid questions, one for each input type, on the same page.  Then add this script to combine them to look like one question:

<script>
$(document).ready(function(){
    // Parameters
    var gridQ1 = 'Q1';
    var gridQ2 = 'Q2';

    // Run
    if (!$('.mobile_grid').length) {
        $('#' + gridQ1 + '_div .inner_table > tbody').append($('#' + gridQ2 + '_div .inner_table > tbody > tr:not(:first-child)'));
    }
    
    else {
        var mobileGridOptions1 = $('#' + gridQ1 + '_div .mobile_grid_options');
        var mobileGridOptions2 = $('#' + gridQ2 + '_div .mobile_grid_options');
        for (var i = 0; i < mobileGridOptions1.length; i++) {
            $(mobileGridOptions1).eq(i).append($(mobileGridOptions2).eq(i).children());
        }
    }
    
    $('#' + gridQ2 + '_div').hide();
})
</script>


"Q1" and "Q2" should be replaced with the names of the two questions.
answered Dec 9, 2021 by Zachary Platinum Sawtooth Software, Inc. (205,575 points)
selected Dec 10, 2021 by Saroeun
Thansks.
...