/
Index.cshtml
54 lines (46 loc) · 1.4 KB
/
Index.cshtml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
@{
Layout = "~/Views/Tarea/_Layout.cshtml";
PageVars.Add("tareas", TempData["tareas"]);
}
<div id='alert' data-bind='visible: mensaje(), css: { error: isError }' style='display: none'>
<span data-bind='text: mensaje()'></span><a href='#' data-bind=' click: cerrar'>X</a>
</div>
<h1>Lista de Tareas</h1>
<div class='loader' data-bind="css: { loading: isLoading() }">Cargando</div>
<table>
<tr>
<th> </th>
<th>Id</th>
<th>Nombre</th>
<th>Descripcion</th>
<th>Status</th>
</tr>
<!-- ko foreach: tareas -->
<tr>
<td><a href="#" data-bind="click: $parent.borrar">x</a>
</td>
<td data-bind="text: id()"></td>
<td data-bind="text: nombre()"></td>
<td data-bind="text: desc()"></td>
<td data-bind="text: status()"></td>
</tr>
<!-- /ko -->
</table>
<div>
<fieldset>
<legend>Nuevo</legend>
<div>
<label>Nombre</label>
<input data-bind="value: tarea().nombre" name="Tarea.Nombre">
</div>
<div>
<label>Desc</label>
<input data-bind="value: tarea().desc" name="Tarea.Desc">
</div>
<div>
<label>Status</label>
<input data-bind="value: tarea().status" name="Tarea.Status">
</div>
<button data-bind='click: agregar'>Agregar</button>
</fieldset>
</div>