datable cell.data---input form

datable cell.data---input form

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

i have this page

'''{.....}
<input type="text" class="form-control" name="ButonNom"placeholder="Nom" >
{....}

Nom Prenom Societe Email Telephone Fax Adresse Date Createdby

</table>

i use datatable to add data to the table using this js file:

{....}

var table = $('#demande').DataTable
(
{
dom: 'Bfrtip',
ajax: 'php/table.demande.php',
columns:
[

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

            }
        ],
        select: 'single',

        buttons: 
        [
            { extend: 'edit',   editor: editor },
            {extend: "selectedSingle",
                text: "Select",
                 action: function ( )
                {
                }
            }

        ]
    }
);

i want one i click on the 'select' button ,the input"ButonNom" receive the data in the selected cell
i tried
table.cell(selected,0).data();

but it didnt work
any help please

Answers

  • ghazimetallicaghazimetallica Posts: 6Questions: 2Answers: 0

    i just add this
    var contenu = table.cell('.selected', 0).data();

                        $('input[name="ButonPrenom"]').val(contenu);
    

    seems to be working if any one could use it :)

This discussion has been closed.