Show column header in text grid question

From Catglobe Wiki
Revision as of 09:39, 2 March 2009 by Catglobe (talk | contribs) (New page: ==Challenge== In order to indicate the unit of values to be put inside a text grid question<br/> As a questionnaire creator<br/> I want to add headers to columns in text grid question<br/>...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Challenge

In order to indicate the unit of values to be put inside a text grid question
As a questionnaire creator
I want to add headers to columns in text grid question
Example
Show column header in text grid.png

Solution

Locate the first sub question's row, add the new row containing the headers before that row.

Code

quest.onInit = function()
{
	$("#grid_subquestion_text_1").parent().before($("<tr><th></th><th>Antal minutter</th></tr>"));
}