How can I add a header to the right statement/answer for a max diff | XM Community
Skip to main content
Solved

How can I add a header to the right statement/answer for a max diff

  • May 26, 2020
  • 7 replies
  • 73 views

How can I add a header to the right statement/answer for a max diff? Currently, I can only do it for the left answer using this:
jQuery("#"+this.questionId+" td.c1:first").html("Statement A");
jQuery("#"+this.questionId+" td.AnswerLeft").html("Statement B");

I can't figure out how to do the same for the right side and the text has to be in line with the column headers

ex1.PNG

Best answer by TomG

For a bipolar matrix:
jQuery("#"+this.questionId+" tr.ColumnLabelHeader").append("Statement B");

7 replies

SurajK
QPN Level 3 ●●●
Forum|alt.badge.img+4
  • QPN Level 3 ●●●
  • May 26, 2020

Use the below code,
jQuery('tbody tr:eq(0)').find('td:last-child').after('Statement B')


Thanks!! However, the new label isn't aligned with statement B. Instead, it looks like it's part of a new empty column.

For now I have just included the labels as part of the question text but this is also not an ideal layout

image.png


TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • Answer
  • May 27, 2020

For a bipolar matrix:
jQuery("#"+this.questionId+" tr.ColumnLabelHeader").append("Statement B");


TomG Thanks for your help!
It looks like it did work but it'd also adding text to the radio buttons. Is there a way to hide these?
image.png


TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • May 28, 2020

It looks like it did work but it'd also adding text to the radio buttons.

That text must be from something else you've done.


SurajK
QPN Level 3 ●●●
Forum|alt.badge.img+4
  • QPN Level 3 ●●●
  • May 28, 2020

Try to add one more td before the actual statement, like this,
jQuery('tbody tr:eq(0)').find('td:last-child').after('Statement B')


SurajK this last one worked!! thanks 😊
image.png