Category : datatables

I want to populate a jQuery datatable based on the content of a textarea. Note: my datatables implementation is not serverside. That is: sorting/filtering happens on the client. I know my php works as it returns expected results in my test scenario (see below). I have included a lot of code to provide context. I ..

Read more

I have used the following code in jquery datatable, I want to specify the javascript code for onClick event but it gives me the error Warning TS1005 (JS) ‘;’ expected & (JS) Expression expected.How to resolve these errors. return ‘<a href="/EmployeeManagement/DeleteEmployee/’ + full.userId + ‘" ‘onClick = return ConfirmDelete(this)’>’; }, "autoWidth": false, "searchable": false, "sortable": ..

Read more

I am working on jquery datatable. I am adding user input data into rows. $(‘.add-row’).on(‘click’, function() { name = $(‘#name’).val(); email = $(‘#email’).val(); cno = $(‘#cno’).val(); bdy = $(‘#bday’).val(); t.row.add([ name, email, cno, bdy, ‘<button class ="btn btn-danger del">Delete</button>’ + ” + ‘<button class="btn btn-warning upd" data-id="’+$(‘#example’).DataTable().rows().count()+’">Edit</button>’ ]).draw(false); $("#name").val(”); $("#email").val(”); $("#cno").val(”); $("#bday").val(”); }); In the ..

Read more

I have an add-row button. On its click I am adding a row into my datatable. $(‘.add-row’).on(‘click’, function() { id = 0; name = $(‘#name’).val(); email = $(‘#email’).val(); cno = $(‘#cno’).val(); bdy = $(‘#bday’).val(); t.row.add([ name, email, cno, bdy, ‘<button class ="btn btn-danger del">Delete</button>’ + ” + ‘<button class="btn btn-warning upd" data-id="’+$(‘#example’).DataTable().rows().count()+’">Edit</button>’ ]).draw(false); $("#name").val(”); $("#email").val(”); ..

Read more

I am trying to update my datatable when I edit some fields in my edit modal. Below is my modal, add row and btnSubmit function to get the edited fields. <div class="modal" id="myModal"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button> <h4 class="modal-title">Close</h4> </div> <div class="modal-body"> <p> <label for="name">Name:</label> <input type="text" ..

Read more

So my mySQL CRUD project using the responsive dataTables.net plugin works fine as long as the screen width is less that 992px. Above that my variables using ‘this’ returns undefined and thus breaks my code: comDirApp.js:201 Uncaught TypeError: Cannot read property ’employeeID’ of undefined’ var editEmployID = table.row(this).data().employeeID; I am not using any custom media ..

Read more