This commit is contained in:
jnunez 2018-08-01 14:23:18 +00:00
parent 23356103f3
commit c6044b83f0
2 changed files with 12 additions and 68 deletions

View file

@ -5,9 +5,9 @@ var Titulo;
jQuery(document).ready(function () {
getDataModel();
});
@ -23,7 +23,7 @@ this.getDataModel = function () {
this.CrearEncuesta = function (data) {
var body = data.questions;
var survey = new Survey.Survey();
survey.locale = "es";
@ -51,74 +51,23 @@ this.CrearEncuesta = function (data) {
q.minRateDescription = item.mininumRateDescription,
q.maxRateDescription = item.maximumRateDescription
}
if (item.type == "matrix") {
q.columns = item.columns
q.rows = item.rows
//q.columns = [];
$.each(item.columns, function (index, columna) {
q.columns.value = columna;
q.columns.text = columna;
//var columna = { value: columna, text: columna };
//q.columns.push(columna);
});
//q.rows = [];
$.each(item.rows, function (index, fila) {
q.rows.value = fila;
q.rows.text = fila;
//var fila = { value: fila, text: fila };
//q.rows.push(fila);
});
}
q.type = item.type;
q.title = item.title;
q.name = item.name;
q.isRequired = item.Requerido == true;
q.isRequired = item.isRequired;
});
//var q = page.addNewQuestion("matrix", "Por favor indique su nivel de satisfacción con las siguintes preguntas")
// q.columns = [
// { value: 1, text: "Totalmente desacuerdo" },
// { value: 2, text: "Desacuerdo" }
// ],
// q.rows = [
// { value: "affordable", text: "Fácil de usar" },
// { value: "does what it claims",text: "Mejor que los demás"}
// ]
$("#surveyElement").Survey({
model: survey
});
//var json = {
// title: data.DetalleEncuestas[0].EncabezadoEncuesta.Descripcion,
// showProgressBar: "top",
// pages: [
// {
// questions: [
// {
// type: "boolean",
// name: "bool",
// title: "Please answer the question digite ",
// label: "Trabaja en el AYA?",
// isRequired: true
// }
// ]
// }
// ]
//};
//window.survey = new Survey.Model(json);
//survey.onComplete.add(function (result) {
// document.querySelector("#surveyResult").innerHTML =
// "result: " + JSON.stringify(result.data);
//});
//$("#surveyElement").Survey({
// model: survey
//});
}
@ -164,7 +113,7 @@ this.CrearEncuesta = function (data) {
// title: "Digite un comentario"
// }
// ]
// },
// {
@ -250,7 +199,7 @@ this.CrearEncuesta = function (data) {
// ]
// };
//if (!window["%hammerhead%"]) {
// init();
//}

View file

@ -17,12 +17,7 @@
</div>
</div>
<div class="modal-footer">
<button type="button" id="btnGuardar" class="btn btn-success btn-medium" data-dismiss="modal">
<i class="fa fa-floppy-o"></i>&nbsp;Guardar
</button>
</div>
</div>
</form>