I'm studying mvc and came across a problem, like loading the result into a dropdownlist.
I actually have two dropdownlists in the same template that I wanted to load, but showing me how to do one I believe I can do the second.
I know it sounds easy, but I'm taking a beating.
I have a button that sends for a query 3 fields, in the controller I see the data but I can not load a dropdpwnlist mustache.
my template
</script>
<script id="template-produto" type="x-tmpl-mustache">
<tr>
<td>
<input class="form-control form-control-sm" type="text" placeholder="De">
</td>
<td>
<input class="form-control form-control-sm" type="text" placeholder="Para">
</td>
<td>
<input class="form-control form-control-sm" type="text" placeholder="Cliente">
</td>
<td>
<select id=" "><option selected="selected" value="">Piloto</option></select>
<td>
<select id=" "><option selected="selected" value="">Carro</option></select>
</td>
<td>
<input class="form-control form-control-sm" type="text"
placeholder="Tempo">
</td>
<td>
<a class="btn btn-warning btn_remover" role="button">
class="glyphicon glyphicon-trash">
</a>
</td>
</tr>
</script>
I appreciate who can help
What I have tried:
public JsonResult RecuperarNN(string DT, string HI, string HF)
{
var ListaA = OperacaoModel.RecuperarListaAeroN(DT, HI, HF);
return Json( ListaA , JsonRequestBehavior.AllowGet);
// return (id and name)
}
function incluir_linha_produto() {
$('#grid tbody').append(Mustache.render($('#template-produto').html() ));
}
I tried as the cod above