Hi,
I have a grid with command in column, and I need to get a cell value from row where button clicked.
this is my grid
Html:
@{
List<object> comandos = new List<object>();
comandos.Add(new { type = "email", buttonOption = new { content = "", cssClass = "e-flat", iconCss = "e-mail e-icons" } });
}
@Html.EJS().Grid("grdBeneficiarios").DataSource(dataManager => { dataManager.Json(Model.ToArray()).InsertUrl("/Contrato/AgregarBeneficiario").RemoveUrl("/Contrato/EliminarBeneficiario").UpdateUrl("/Contrato/ActualizarBeneficiario").Adaptor("RemoteSaveAdaptor");}).ActionBegin("actionBegin").Columns(col =>
{
col.Field("IdBeneficiario").IsPrimaryKey(true).IsIdentity(true).Visible(false).Add();
col.Field("IdTiposIdentificacion").HeaderText("Tipo id").ForeignKeyField("IdTiposIdentificacion").ForeignKeyValue("Nombre").DataSource((List<TipoIdViewModel>)PersonaServices.GetTiposId()).Add();
col.Field("NumeroId").HeaderText("Numero id").Add();
col.Field("PrimerNombre").HeaderText("Primer nombre").Visible(false).Add();
col.Field("SegundoNombre").HeaderText("Segundo nombre").Visible(false).Add();
col.Field("PrimerApellido").HeaderText("Primer apellido").Visible(false).Add();
col.Field("SegundoApellido").HeaderText("Segundo apellido").Visible(false).Add();
col.Field("NombreCompleto").HeaderText("Nombre").Add();
col.Field("TelefonoMovil").HeaderText("Celular").Add();
col.Field("Email").HeaderText("Email").Add();
col.Field("IdSede").HeaderText("Sede").ForeignKeyField("IdSede").ForeignKeyValue("Nombre").DataSource((List<SedeViewModel>)ContratoServices.GetSedes().FindAll(s => s.Habilitado)).Add();
col.Field("WelcomeDay").HeaderText("Welcome day").EditType("datetimepickeredit").Add();
col.Field("Observaciones").HeaderText("Obs").Add();
col.HeaderText("Enviar email").Width("160").Commands(comandos).Add();
col.Field("IdContrato").Visible(false).Add();
}).Locale("es-CO").Load("load").EditSettings(edit => { edit.AllowAdding(true).AllowEditing(true).AllowDeleting(true).Mode(Syncfusion.EJ2.Grids.EditMode.Dialog); }).Toolbar(toolbarItems).Render()
script:
function load(args) {
this.columns[13].commands[0].buttonOption.click = function (args) {
debugger;
var x = correo;
var gridObj = ej.base.getComponent(document.getElementById("grdBeneficiarios"), ej.grids.Grid);
??? how to get the row or better, the cell value in "Email" column ?
};
Thanks for your help.
Kind regards,
Juan J.