Scroll

Non Selectable Items in ADC Grids

Non Selectable Items in ADC Grids

Follow
Summary This article describes how to disable the input of certain cells in your ADC grid questions using css and javascipt
Applies to askiadesign
Written for Survey scripter
Keywords ADC; ADX; Responsive Table; Vertical Table; Horizontal Table; Grid; Loop; Parent; Child; Input; Disable; Question table.

 

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'","")!!

 

mceclip1.png

This will hide responses A & B for the first iteration:

mceclip0.png

 

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:

mceclip2.png

loopx iterations/responses:

mceclip3.png

qx responses:

mceclip5.png

The asterisks (*) denote which cells to disable when their row and column intersect in the response grid. The screen set-up looks like this:

mceclip6.png

 

Note the sections of the style/script syntax where we have:

!!OrderOf("loopx").IndexOf(1)!!
!!OrderOf("loopx").IndexOf(2)!!

These these focus on which row (tr) (response of loopx) to hide and disable.

mceclip7.png

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.

Have more questions? Submit a request

Comments