You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
1.8 KiB
27 lines
1.8 KiB
{% if tarea[0].alias=='exercise17'%} function addRow(table, dependant){
|
|
var rowCount = table.find("tbody").find("tr").length;
|
|
console.log(rowCount);
|
|
{% set dependant='' %}
|
|
{% for pregunta in tarea[0].SeccionesTareaId[0].PreguntasId %}
|
|
{% if pregunta.alias=='ex17preg20' %}
|
|
{% set dependant=pregunta.TipoPreguntaOptions|raw %}
|
|
{% endif %}
|
|
{% endfor %}
|
|
var input='<tr>';
|
|
{% for pregunta in tarea[0].SeccionesTareaId[0].PreguntasId %}
|
|
{% if pregunta.alias=='ex17preg10' %}
|
|
input+=`<td><input type="text" class="form-control" id="{{pregunta.alias}}-`+rowCount+`" name="{{pregunta.alias}}[]" placeholder="{{ pregunta.placeholder|trans({}) }} {% if not pregunta.editable and 'caso_estudio' not in app.user.username %} readonly {% endif %}"></td>`;
|
|
{% elseif pregunta.alias=='ex17preg20' %}
|
|
input+=`<td><input type="text" id="{{pregunta.alias}}-`+rowCount+`" data-sonata-select2 = "false" style="width:80%;top: 28px; z-index: 100;" name="{{pregunta.alias}}[]" ></input></td><td>`;
|
|
{% elseif pregunta.alias=='ex17preg21' %}
|
|
input+=`<input type="text" class="form-control" id="{{pregunta.alias}}-`+rowCount+`" name="{{pregunta.alias}}[]" placeholder="{{ pregunta.placeholder|trans({}) }} {% if not pregunta.editable and 'caso_estudio' not in app.user.username %} readonly {% endif %}"></td><td><button type="button" class="btn btn-warning delete-row" onclick="$(this).parents('tr').remove();">Delete Row</button></td>`;
|
|
{% endif %}
|
|
{% endfor %}
|
|
input+=`</tr>`;
|
|
table.append(input);
|
|
var dependant = {{ dependant|raw }};
|
|
$("#ex17preg20-"+rowCount).select3({ data: dependant});
|
|
setTimeout(function(){ $("#ex17preg20-0").next().next().remove();}, 2000);
|
|
|
|
}
|
|
{% endif %}
|