Non Selectable Items in ADC Grids
This article describes how to disable the input of certain cells.
in your ADC grid questions using CSS and JavaScript.
Non selectable items in grid questions has a solution where you apply a small piece of script in the modalities of the response block:
!!On(CI(1)=1,"style='display:none;' disabled='true'","")!!
This will hide responses A & B for the first iteration:
This method, however, is not compatible with grids which use ADCs. Instead, a different approach is required. The example QEX file can be downloaded here.
We have a simple loop set-up:
loopx iterations/responses:
qx responses:
The asterisks (*) denote which cells to disable when their row and column intersect in the response grid. The screen set-up looks like this:
Note the sections of the style/script syntax where we have:
!!OrderOf("loopx").IndexOf(1)!!
!!OrderOf("loopx").IndexOf(2)!!
These focus on which row (tr) (response of loopx) to hide and disable.
Similarly, note these sections where focus on which cell/column position (td) (response of qx) to hide and disable. The '+1' part is to account for the first title column which does not relate to a response of qx.
!!OrderOf("qx").IndexOf(2)+1!!
These 3 parts of the syntax could be simply replaced by 1, 2 & 3 but then the cell hiding would not work when randomisation is enabled on the loop and child question. In the example QEX you will see randomisation is used for both and the hidden cells are always correctly set.
Hopefully the above is enough for you to adapt or extend the CSS/JavaScript in the example and apply it to your own cell hiding requirements in ADC grids.