Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

160
Visualizações
EJ2 Grid, Pulling The Id from the Row

I am working the an EJ2 Grid and I have an Edit and Delete option. With the EJ grid passing the Id field worked with no issues with the onClick. The same thing is not working with the EJ2 Grid.

        var grid = new ej.grids.Grid({
        dataSource: @Html.Raw(JsonConvert.SerializeObject((Model), new JavaScriptDateTimeConverter())),
        allowExcelExport: true,
        allowPdfExport: true,
        toolbar: ['ExcelExport', 'PdfExport', 'CsvExport'],
        allowSelection: true,
        allowFiltering: true,
        allowSorting: true,
        //allowPaging: true,
        allowNumberFormatting: true,
        enableVirtualization: true,
        filterSettings: { type: 'Excel' },
        selectionSettings: { persistSelection: true, type: "Multiple", checkboxOnly: true },
        enableHover: false,
        enableHeaderFocus: true,
        height: 600,
        rowHeight: 38,
        columns: [
            { field: "Id", visible: false, allowEditing: false },
            { field: "Name",                  headerText: "Name",               width: 100 },
            { field: "ElectionDate",          headerText: "ElectionDate",       width: 80, format: "MM/dd/yyyy"},
            { field: "RegistrationClose",     headerText: "Registration Close", width: 80, format: "MM/dd/yyyy", },
            { field: "RegularAbsenteeStart",  headerText: "Absentee Start",     width: 80, format: "MM/dd/yyyy"},
            { field: "EarlyVotingStart",      headerText: "Early Voting Start", width: 80, format: "MM/dd/yyyy"},
            { field: "GraceVotingStart",      headerText: "Grace Voting Start", width: 80, format: "MM/dd/yyyy",},
            { field: "ElectionTypeName",      headerText: "ElectionType",       width: 110, },
            { field: "Active",                headerText: "Active",             width: 70 },
            {
                headerText: "",
                template: '<a href="#" onclick="Edit({{:Id}})">Edit</a>',
                width: 40,
                textAlign: "center"
            },
            {
                headerText: "",
                template: '<a href="#" data-url="@Url.Action("Delete")/{{:Id}}" data-name="{{:Name}}" data-toggle="modal" data-target="#confirmModal">Delete</a>',
                width: 40,
                textAlign: "center"
            },
        ],
        //pageSettings: { pageSizes: true, pageSize: 8 }
    });

    grid.appendTo("#dataGrid_EJ2");
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

The template changed in EJ2. EJ it was {{:Id}} EJ2 it changed to ${Id}

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda