How can I refer to a specific data in a row?

How can I refer to a specific data in a row?

JoelchiitoJoelchiito Posts: 1Questions: 1Answers: 0
edited February 2021 in Free community support

I am testing the use of the DataTable for the first time, everything was regularly fine until I want to modify, I am testing the edit button but it does not refer to the id of the row I want to edit and this causes my Edit view to give me an error.

I tried using Ajax but it goes straight to the view with HTTP, and it marks an error.

This is my Ajax for body of my DataTable:

$('#lista').DataTable({
                columns: [
                    { title: "id", data:"idMarcas" },
                    { title: "Marca", data:"Marcas" },
                    { title: "Activo", data: "Activo" },


In the end I chose to use this, my button Eliminar is Ok but my button Edit not:
{
                        defaultContent:
                            "<div class='text-center'><div class='btn-group'><button class='btn btn-primary btn-sm btnEdit'><a class='toBoton' href='ModificarMarca?idMarcas=#idMarcas'>Editar</a></button><button class='btn btn-danger btn-sm btnBorrar'>Eliminar</button></div></div>"
                    }

I want to refer to { title: "id", data:"idMarcas" } in my href: href='ModificarMarca?idMarcas=#idMarcas'

Please,I need help :cry:

Edited by Kevin: Syntax highlighting. Details on how to highlight code using markdown can be found in this guide

Answers

This discussion has been closed.