Skip to content

Instantly share code, notes, and snippets.

@marti1125
Last active December 14, 2015 07:19
Show Gist options
  • Save marti1125/5049441 to your computer and use it in GitHub Desktop.
Save marti1125/5049441 to your computer and use it in GitHub Desktop.
blank.html crud
<div div class="wizard" id="wizard-crud">
<h1>Agregar Aplicación</h1>
<div class="wizard-card" data-cardname="aplicacion">
<h3 class="noshowtitle">Aplicacion</h3>
#{form action:@create(), enctype:'multipart/form-data', class:'form-horizontal', id:'crear'}
<div class="formWizard">
#{crud.form /}
</div>
#{/form}
</div>
<div class="wizard-card" data-cardname="opcion">
<h3 class="noshowtitle">Opción</h3>
<div id="frmOpcion">
<p><a class="btn btn-primary" href="#" id="opcionAdd"><i class="icon-plus-sign-alt"></i>&nbsp; Añadir Opción</a></p>
<table class="table table-striped table-bordered tableg opciones">
<thead>
<th class="th-style">Cod</th>
<th class="th-style">Padre</th>
<th class="th-style">Descipción</th>
<th class="th-style">URL</th>
<th class="th-style"></th>
</thead>
<tbody>
<tr>
<td><input type="text" class="opInputcod" placeholder="Código"/></td>
<td><input type="text" class="opInputcod" placeholder="Padre"/></td>
<td><input type="text" class="opInput" placeholder="Descipción"/></td>
<td><input type="text" class="opInput" placeholder="URL"/></td>
<td><i class="icon-minus-sign icon-2x"></i></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<script type="text/javascript">
$('#opcionAdd').click(function(e){
e.preventDefault();
$('.opciones').append('<tr><td><input type="text" class="opInputcod" placeholder="Código"/></td>'+ '<td><input type="text" class="opInputcod" placeholder="Padre"/></td>'+
'<td><input type="text" class="opInput" placeholder="Descipción"/></td>'+
'<td><input type="text" class="opInput" placeholder="URL"/></td></tr>');
});
$('#crear').ajaxForm({
success: function(response, status, xhr, $form){
if(response == '' ){
$('#modalAcciones').modal('hide');
location.reload();
}else {
$("#acciones").html(response);
}
}
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment