I want to edit just many column ... is it possible ?

I want to edit just many column ... is it possible ?

fatihafatiha Posts: 7Questions: 4Answers: 0

Hi all , i want to make datatable editable for just some column, is it possible ??
thanks in advance

Answers

  • vogomatixvogomatix Posts: 38Questions: 3Answers: 7

    Yes it is certainly possible - I am using a custom editor library to do this, but it can be equally solved by download the Editor library to do this, or write your own.

  • fatihafatiha Posts: 7Questions: 4Answers: 0

    I just used the code below :
    $(document).ready(function() {

                            $('table.display').dataTable( {
                                   "bPaginate"      : false,
                                    "bFilter"       : false
                               } );
    
                               /* Init DataTables */
                               var oTable = $('table.display').dataTable();
    
                               /* Apply the jEditable handlers to the table */
                               oTable.$("td.editable").editable( './updateData.php', {
                                   "callback": function( sValue, y ) {
                                       var aPos = oTable.fnGetPosition( this );
                                       oTable.fnUpdate( sValue, aPos[0], aPos[1] );
                                       window.location.reload();
                                   },
                                   "submitdata": function ( value, settings ) {
                                       console.log(this);
                                       return {
                                           "row_id": oTable.fnGetData( this.parentNode )[0],
                                           "column": oTable.fnGetPosition( this )[2]
                                       };
                                   },
                                   "height": "20px",
                                   "width": "100%"
                               } );
                           } );
    

    it works great , but the problem is that it doesn't work for many datatables , i can edit the column for just the first table ... how can i solve it ?

This discussion has been closed.