Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @model PagedList.IPagedList<WebApp.Models.QuestionsFoo>
- @using PagedList.Mvc;
- @{
- ViewBag.Title = "Questions Foo";
- Layout = null;
- }
- <p>
- <a href="@Url.Action("Create", "QuestionFoo")" class="btn btn-primary">
- New
- </a>
- </p>
- @using (Ajax.BeginForm("Index", "Preguntas_Anamnesis",new AjaxOptions { HttpMethod = "POST" } , new { id = "formSearchQuestionFoo"}))
- {
- <p>
- Buscar @Html.TextBox("SearchString")
- <button type="submit" value="Buscar" class="btn btn-primary"><span class="glyphicon glyphicon-search"></span></button>
- </p>
- }
- <table class="table">
- <tr>
- <th>
- Clinica
- </th>
- <th>
- @Ajax.ActionLink("Question","Index","QuestionFoo",null, new AjaxOptions { UpdateTargetId = "viewHtml"},null)
- </th>
- <th>
- Pregunta Force
- </th>
- <th>
- Status
- </th>
- <th></th>
- </tr>
- @foreach (var item in Model)
- {
- <tr>
- <td>
- @Html.DisplayFor(modelItem => item.Clinica.Descripcion_Clinica)
- </td>
- <td>
- @Html.DisplayFor(modelItem => item.Pregunta)
- </td>
- <td>
- @Html.DisplayFor(modelItem => item.Pregunta_Forzada)
- </td>
- <td>
- @Html.DisplayFor(modelItem => item.Status.Descripcion_Status)
- </td>
- <td>
- @Html.ActionLink("Editar", "Edit","QuestionFoo", new { id = item.IDPregunta }) |
- @Html.ActionLink("Detalles", "Details","QuestionFoo", new { id = item.IDPregunta }) |
- @Html.ActionLink("Eliminar", "Delete","QuestionFoo", new { id = item.IDPregunta })
- </td>
- </tr>
- }
- </table>
- Pagina @(Model.PageCount < Model.PageNumber ? 0 : Model.PageNumber) de @Model.PageCount
- @Html.PagedListPager(Model, page => "javascript:void(0)",
- new PagedListRenderOptions
- {
- FunctionToTransformEachPageLink = (liTag, aTag) =>
- {
- aTag.Attributes.Add("data-page", aTag.InnerHtml);
- aTag.Attributes.Add("class", "pageQuestionFoo");
- liTag.InnerHtml = aTag.ToString(); return liTag;
- }
- })
- <script type="text/javascript">
- $('.pageQuestionFoo').click(function (e) {
- e.preventDefault();
- var page = $(this).data().page;
- $.ajax({
- url: "/QuestionFoo/Index",
- dataType: 'html',
- type: 'POST',
- data: { sortOrder: null, currentFilter: null , searchString: $("[name=SearchString]").val(), page: page }
- }).then(function (viewHtml) {
- $('#viewHtmlTabClinica').html(viewHtml);
- });
- });
- $("#formSearchQuestionFoo").submit(function () {
- $.ajax({
- url: "/QuestionFoo/Index",
- type: this.method,
- data: $(this).serialize(),
- success: function (data, status, xhr) {
- $('#viewHtmlTabClinica').html(data);
- },
- error: function (xhr, textStatus, error) {
- }
- })
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement