Ver Mensaje Individual
  #1 (permalink)  
Antiguo 02/08/2013, 16:12
jnavarrete2311
 
Fecha de Ingreso: noviembre-2012
Mensajes: 30
Antigüedad: 11 años, 5 meses
Puntos: 0
Leer el row seleccionado WebGre MVC3 Razor

Que tal.
Estoy desarrollando una pagina web com MVC3 razor el problema es que tengo un webgrid en el cual utilizo unas imágenes como botones para abrir popups modales con @Html.ActionLink y en uno de estos requiero tomar un valor de la linea que seleccione, pero no consigo hacerlo me podrían ayudar, para saber como leer la linea seleccionada, de preferencia sin utilizar el "@item.GetSelectLink" ya que ese método no me permite agregar imágenes como botones o links.
Este es el código de la vista:

Código HTML:
Ver original
  1. @model IEnumerable<SoporteSAP.Models.TicketModel>
  2. @{
  3.     ViewBag.Title = "Ticket";
  4.     WebGrid grid = new WebGrid(Model,selectionFieldName:"SelectedRow");
  5. }
  6.  
  7. <h2>Ticket</h2>
  8. @*<img src="@Url.Content("~/Images/add.png")"</img>*@
  9.  
  10.  <script type="text/javascript">
  11.  
  12.      $.ajaxSetup({ cache: false });
  13.  
  14.      $(document).ready(function () {
  15.          $(".openDialog").live("click", function (e) {
  16.              e.preventDefault();
  17.  
  18.              $("<div></div>")
  19.                     .addClass("dialog")
  20.                     .attr("id", $(this)
  21.                     .attr("data-dialog-id"))
  22.                     .appendTo("body")
  23.                     .dialog({
  24.                         title: $(this).attr("data-dialog-title"),
  25.                         close: function () { $(this).remove(); },
  26.                         modal: true,
  27.                         height: 303,
  28.                         width: 568,
  29.                         left: 0
  30.                     })
  31.                     .load(this.href);
  32.          });
  33.  
  34.          $(".close").live("click", function (e) {
  35.              e.preventDefault();
  36.              $(this).closest(".dialog").dialog("close");
  37.          });
  38.      });
  39.     </script>
  40.  
  41.       @if (TempData["Message"] != null)
  42.         {
  43.             <script>alert('Se agrego la actividad');</script>
  44.             TempData["Message"] = null;
  45.         }
  46.  
  47. @grid.GetHtml(columns: new[]{
  48.     grid.Column("ID"),
  49.     grid.Column(
  50.        "",
  51.         header: "",
  52.         format: @<text>
  53.                 @Html.ActionLink(" ", "DetalleTicket", "Ticket", null, new { style = "background: url('" + Url.Content("~/Images/lupa.gif") + "') no-repeat; display:block; height:15px; width:16px;", @class = "openDialog", data_dialog_id = "aboutlDialog", data_dialog_title = "Detalle de Ticket" })
  54.                </text>),
  55. grid.Column(
  56.        " ",
  57.         header: " ",
  58.         format:
  59.          @<text>
  60.                @Html.ActionLink(" ", "NuevaActividad", "NuevaActividad", null, new { style = "background: url('" + Url.Content("~/Images/add.png") + "') no-repeat; display:block; height:15px; width:16px;", @class = "openDialog", data_dialog_id = "aboutlDialog", data_dialog_title = "Nueva Actividad" })
  61.                </text>),
  62. grid.Column("Cliente"),
  63. grid.Column("Asunto"),
  64. grid.Column("EstatusLlamada","Estatus"),
  65. grid.Column("Prioridad"),
  66. grid.Column("FechaCreacion","Fecha de Creacion"),
  67. grid.Column("Partner")
  68. })
  69.  
  70.   @if (grid.SelectedIndex == 1)
  71.   {
  72.       Session["CallId"] = grid.SelectedRow["ID"].ToString();
  73.      
  74.   }
  75.     @Html.ActionLink("Nuevo Ticket", "NvoTicket", "NvoTicket", null, new { @class = "openDialog", data_dialog_id = "aboutlDialog", data_dialog_title = "Nuevo Ticket" })