Trying to customise the formatting on a matrix table | XM Community
Skip to main content
Question

Trying to customise the formatting on a matrix table

  • February 24, 2021
  • 6 replies
  • 96 views

MikeW
Level 5 ●●●●●
Forum|alt.badge.img+14
  • Level 5 ●●●●●
  • 137 replies

I've got a matrix table that looks like this:
matrix-table-CURRENT.PNGWhat JavaScript could I apply so that the table looks more like:
matrix-table-WOULD LIKE.PNGIs this possible?

6 replies

ElieD
QPN Level 4 ●●●●
Forum|alt.badge.img+38
  • QPN Level 4 ●●●●
  • 123 replies
  • February 24, 2021

Hi MikeW

Could you share your question type and parameters ?
It's gonna be easier to try it we have the same base.

In your example, It seems that yyy and zzz are labels and you want to disable the inputs, right ?



MikeW
Level 5 ●●●●●
Forum|alt.badge.img+14
  • Author
  • Level 5 ●●●●●
  • 137 replies
  • February 24, 2021

Hi ElieD - it's a Matrix question (constant sum).
I've put yyy and zzz in as default choices, but I want to format them so they don't look like question boxes any more. And, then make them read only.
Hope that helps? Do you need any more information?
Many thanks
Mike


ElieD
QPN Level 4 ●●●●
Forum|alt.badge.img+38
  • QPN Level 4 ●●●●
  • 123 replies
  • February 24, 2021

I'm not sure the matrix and javascript is the right solution because you can't put text in a constant sum matrix.
Your defauld "yyy" is replaced with "0. in the preview.

Anyway, here is a piece of code to disable some parts of the matrix:
image.pngYou'll have to identify the boxes you want to disable by their position (row/column)
In my case, row 1 and column 11 for yyy (cause I modify the question many times !)


MikeW
Level 5 ●●●●●
Forum|alt.badge.img+14
  • Author
  • Level 5 ●●●●●
  • 137 replies
  • February 25, 2021

Hi ElieD
You are right - Matrix Constant Sum question isn't great as even though it displays... the text answers aren't valid responses.
I can change it to text boxes, but then I would need to create a total row and sum the entered figures?


ElieD
QPN Level 4 ●●●●
Forum|alt.badge.img+38
  • QPN Level 4 ●●●●
  • 123 replies
  • February 25, 2021

Why don't you make 2 questions ?
One for aaa-ddd and another one for yyy-zzz.

You could have your 2 Matrix Constant Sum questions in the same page.


MikeW
Level 5 ●●●●●
Forum|alt.badge.img+14
  • Author
  • Level 5 ●●●●●
  • 137 replies
  • February 25, 2021

I might have to resort to that, but was trying to do it as one combined question.... though I appreciate that it is tricky.


Leave a Reply