disable/enable table select

disable/enable table select

ghazimetallicaghazimetallica Posts: 6Questions: 2Answers: 0
edited December 2015 in Free community support

hi i am using an edititable datatable with 2 butons (edit data, and lock in)
i want when i select an element in the table the press the buton select
the table become non editable and the select buton(lock in) become lock out
i tried many combination but didnt work
any idea or help please
what should i add to this code please
{
(function($){

$(document).ready(function() {
var editor = new $.fn.dataTable.Editor( {
ajax: 'php/table.client.php',
table: '#client',
fields: [

        {
            "label": "Nom",
            "name": "Nom"
        },
        {
            "label": "Prenom",
            "name": "Prenom"
        },
        {
            "label": "Societe",
            "name": "Societe"
        },
        {
            "label": "Email",
            "name": "Email"
        },
        {
            "label": "Telephone",
            "name": "Telephone"
        },
        {
            "label": "Fax",
            "name": "Fax"
        },
        {
            "label": "Adresse",
            "name": "Adresse"
        },
        {
            "label": "Date",
            "name": "Date"
        },
        {
            "label": "Createdby",
            "name": "Createdby"
        }
    ]
} );
var table = $('#client').DataTable( {
    dom: 'Bfrtip',
    ajax: 'php/table.client.php',
    columns: 
    [

        {
            "data": "Nom"
        },
        {
            "data": "Prenom"
        },
        {
            "data": "Societe"
        },
        {
            "data": "Email"
        },
        {
            "data": "Telephone"
        },
        {
            "data": "Fax"
        },
        {
            "data": "Adresse"
        },
        {
            "data": "Date"
        },
        {
            "data": "Createdby"

        }
    ],
    select: true,
    lengthChange: false,
    buttons: 
    [
        { extend: 'edit',   editor: editor },
        {
            extend: "selectedSingle",
            text: "Lock in",
            action: function ( ) 
            {

            }
        },

    ]
}
);

} );

}(jQuery));
}

Answers

  • ghazimetallicaghazimetallica Posts: 6Questions: 2Answers: 0

    Is this possible or not?
    Any one please can help me

  • ghazimetallicaghazimetallica Posts: 6Questions: 2Answers: 0

    any one please
    any help

  • ghazimetallicaghazimetallica Posts: 6Questions: 2Answers: 0

    i think once the table is initiliazed this option cant be modified
    so i tested
    table.destroy();
    then recreate the table and set
    select:false

    its working for the moment but its kinda silly
    why cant i change this methode once the table is intilialized
    ....
    still waiting for any help

This discussion has been closed.