Wednesday, 3 July 2019

Is there any way to edit rows in datatable?

I have a datatable that fetch records from database with ajax. I want to add edit tooltip like editor extension in datatable but for free. Is there any plugin to do this? if not can any one help me how to do this manually?

<script>
 $('#table_id').DataTable({
        "serverSide": true,
        "processing" : true,
        "ajax" : function (data , callback, settings) {
            $.ajax({
                url: '/some url,
                type: 'GET',
                data: data,
                success: function( data){
                    console.log(data)
                }
            });

        },
        "columns": [

            {
                "title": "edit",
                "data": null,
                "className": "center",
                "defaultContent": '<a href="" class="editor_edit">Edit</a> / <a href="" class="editor_remove">Delete</a>'
            },
            {
                "title": "name",
                "data": "name"
            },
            {
                "title": "id",
                "data": "id"
            },

        ]
    });
</script>

This is my js.



from Is there any way to edit rows in datatable?

No comments:

Post a Comment