Quantcast
Channel: Free community support — DataTables forums
Viewing all articles
Browse latest Browse all 35364

Show data jQuery

$
0
0

I'm try to show data but i have errors

[{
    "id": 5,
    "nome_fantasia": "Danillo Leão Lopes",
    "cnpj_cpf": "600.520.763-69",
    "telefone": "(99) 99102-6245",
    "pessoa": 1,
    "contribuinte": 9
}, {
    "id": 6,
    "nome_fantasia": "Samuel Fernandes Leão",
    "cnpj_cpf": "000.000.000-00",
    "telefone": "(00) 00000-0000",
    "pessoa": 1,
    "contribuinte": 9
}, {
    "id": 7,
    "nome_fantasia": "Luciane Leão Lopes",
    "cnpj_cpf": "000.000.000-00",
    "telefone": "(00) 00000-0000",
    "pessoa": 1,
    "contribuinte": 9
}, {
    "id": 8,
    "nome_fantasia": "Raimundo Lopes Dias Filho",
    "cnpj_cpf": "000.000.000-00",
    "telefone": "(00) 00000-0000",
    "pessoa": 1,
    "contribuinte": 9
}, {
    "id": 9,
    "nome_fantasia": "Alisson Leão Lopes",
    "cnpj_cpf": "000.000.000-00",
    "telefone": "(00) 00000-0000",
    "pessoa": 1,
    "contribuinte": 9
}, {
    "id": 10,
    "nome_fantasia": "Bruno Leão Lopes",
    "cnpj_cpf": "000.000.000-00",
    "telefone": "(00) 00000-0000",
    "pessoa": 1,
    "contribuinte": 9
}]

$.ajax({
        url: '/pesquisa/registros/clientes',
        data: {
            'registros':registros
        },
        dataType:'json',
        success: function(data){
            $('#clts').DataTable({
                processing:true,
                serverSide:true,
                data: data,
                columns: [
                    { title: "#" },
                    { title: "Nome" },
                    { title: "CNPJ" },
                    { title: "Telefone" },
                    { title: "#" },
                    { title: "#" }
                ],
            })
        },
        error: function(error){
            alert(JSON.stringify(error))
        }
    })

Viewing all articles
Browse latest Browse all 35364

Trending Articles