Difference between revisions of "Hide sub question text column in a grid question"

From Catglobe Wiki
Jump to: navigation, search
Line 7: Line 7:
 
I want to hide the sub question text column  
 
I want to hide the sub question text column  
  
'''Example'''
+
'''Example'''  
  
When creating a scale grid question, its sub question text is displayed as a column in the grid.
+
When creating a scale grid question, its sub question text is displayed as a column in the grid.  
  
[[Image:QuestionTips_HideText_1.jpg]]
+
[[Image:QuestionTips HideText 1.jpg]]  
  
I want to hide that column because it has no use in my context.
+
I want to hide that column because it has no use in my context.  
  
[[Image:QuestionTips_HideText_2.jpg]]
+
[[Image:QuestionTips HideText 2.jpg]] 
 +
 
 +
== Solution ==
 +
 
 +
The style sheet applied to sub question text cells is grid_subquestion_text, therefore we need to search all the elements using that style sheet class and hide them.
 +
 
 +
== Code ==
 +
<source lang="javascript" line="1">
 +
quest.onInit = function()
 +
{
 +
$(".grid_subquestion_text").hide();
 +
}
 +
</source>

Revision as of 09:38, 18 December 2008

Challenge

In order not to show sub question texts in a grid question

As a questionnaire creator

I want to hide the sub question text column

Example

When creating a scale grid question, its sub question text is displayed as a column in the grid.

QuestionTips HideText 1.jpg

I want to hide that column because it has no use in my context.

QuestionTips HideText 2.jpg 

Solution

The style sheet applied to sub question text cells is grid_subquestion_text, therefore we need to search all the elements using that style sheet class and hide them.

Code

1 quest.onInit = function()
2 {
3 	$(".grid_subquestion_text").hide();		
4 }