Survey.StylesManager.applyTheme("default");
var json = {
showQuestionNumbers: "off",
questions: [
{
type: "matrixdropdown",
name: "Feelings",
title: "What do your feel?",
columns: [
{
name: "col1",
cellType: "radiogroup",
showInMultipleColumns: true,
isRequired: true,
choices: [
"Strongly disagree",
"Disagree",
"Neutral",
"Agree",
"Strongly agree"
]
},
{
name: "comment",
title: "Please comment",
cellType: "comment"
}
],
rows: [
"Excited",
"Enthusiastic",
"Open",
"Physically safe",
"Emotionally safe",
"Apprehensive",
"Nervous",
"Scared"
]
}
]
};
window.survey = new Survey.Model(json);
survey.onComplete.add(function(result) {
document.querySelector('#surveyResult').textContent =
"Result JSON:\n" + JSON.stringify(result.data, null, 3);
});
var app = new Vue({
el: '#surveyElement',
data:
{
survey: survey
}
});
<!DOCTYPE html>
<html lang="en">
<head>
<title>Matrix checkbox/radiogroup question located in several columns, Vue Survey Library Example</title>
<meta name="viewport" content="width=device-width" />
<script src="https://unpkg.com/vue/dist/vue.js"></script>
<script src="/DevBuilds/survey-vue/survey.vue.min.js"></script>
<link href="/DevBuilds/survey-knockout/survey.min.css" type="text/css" rel="stylesheet" />
<link rel="stylesheet" href="./index.css">
</head>
<body>
<div id="surveyElement" style="display:inline-block;width:100%;">
<survey :survey='survey' />
</div>
<div id="surveyResult"></div>
<script type="text/javascript" src="./index.js"></script>
</body>
</html>