Skip to content

myCallbackFunction not working #104

@rdlridlo

Description

@rdlridlo

please help, i'm using laravel, I have following the tutorial for celledit, but i have problem and cannot fix it till now, here my code and error

<table id="data_table" class="display table table-hover table-sm">
  <thead>
    <tr>
      <th><b>No.</b></th>
      <th>data1</th>
      <th>data2</th>
      <th>data3</th>
      <th>data4</th>
      <th>data5</th>
    </tr>
  </thead>

  <tbody>
  @foreach ($alfa as $item)
    <tr>
      <td>{{$item->data1}}</td>
      <td>{{$item->data2}}</td>
      <td>{{$item->data3}}</td>
      <td>{{$item->data4}}</td>
      <td>{{$item->data5}}</td>
      <td>{{$item->data6}}</td>
      
    </tr>
  @endforeach
  </tbody>
</table>
<script>

    var table;
    $(document).ready(function () {
          $.noConflict();
        table = $('#data_table').DataTable();

        table.MakeCellsEditable({
            "onUpdate": myCallbackFunction
        });
    });

    function myCallbackFunction(updatedCell, updatedRow, oldValue) {
        console.log("The new value for the cell is: " + updatedCell.data());
        console.log("The old value for that cell was: " + oldValue);
        console.log("The values for each cell in that row are: " + updatedRow.data());
    }
    
</script>

error message when click out of the input box
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions