Link Edit and Delete in column

Link Edit and Delete in column

capitaobrazilcapitaobrazil Posts: 7Questions: 0Answers: 0
edited June 2014 in Free community support

Hello!
Everything is working, just can not retrieve the ID to send a page of edition that I have ready and also to Delete, I post my code below, if you can help me, I will be eternally grateful.

load.js

$(document).ready(function(){
        $('#grid').DataTable({
            "bProcessing": true,
            "sAjaxSource": "grid.php",
            "bJQueryUI": true,
            "sAjaxDataProp": "",
            "aoColumns": [
                {"mDataProp": "idedital_convocaca"},
                {"mDataProp": "datavotacao"},
                {"mDataProp": "localvotacao"},
                {"mDataProp": "idedital_convocacao"}
            ],
            "mRender": function( data, type, full) {
                return '<a href="edit.php?id='+full[0]+'">edit</a>';
            }
        });
});

table.php

                    <table id="grid" class="display">
                        <thead>
                        <tr>
                            <th>Local Votação</th>
                            <th>Local Votação</th>
                            <th>Data Votação</th>
                            <th>Edit</th>
                        </tr>
                        </thead>

                    <tbody>
                    </tbody>

Replies

  • capitaobrazilcapitaobrazil Posts: 7Questions: 0Answers: 0

    Solved

     $(document).ready(function(){
            $('#grid').DataTable({
                "bProcessing": true,
                "sAjaxSource": "grid.php",
                "sServerMethod": "POST",
                "sAjaxDataProp": "",
                "aoColumnDefs": [{
                "aTargets": [3],
                "mData": "link",
                "mRender": function( data, type, full) {
                    return '<a href="edit.php?edit='+data+'">Edit</a>';
                }
            }],
            "aoColumns": [
                {"mDataProp": "id"},
                {"mDataProp": "datavotacao"},
                {"mDataProp": "localvotacao"},
                {"mDataProp": "id"}
            ],
    
This discussion has been closed.