Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

myCallbackFunction not working #104

Open
rdlridlo opened this issue Apr 17, 2023 · 0 comments
Open

myCallbackFunction not working #104

rdlridlo opened this issue Apr 17, 2023 · 0 comments

Comments

@rdlridlo
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant