AJAX - filtering/adding links
AJAX - filtering/adding links
charliegriefer
Posts: 1Questions: 0Answers: 0
Hi All:
I've implemented DataTables a few times, but doing it for the first time via AJAX. I've finally gotten it to the point where it's doing its initial data load (yay, me). Have a couple of questions moving forward...
I had a checkbox in place before that would display inactive records (they're not returned by default). We've got a column in the database table (isActive), and checking this checkbox and hitting "search" button would display all records (inactives included). Can I implement something similar via AJAX?
What happens so far is the page is loaded with only active records. On checking the checkbox, I'd like to trigger a refresh of the data so that inactive records are loaded as well. Any pointers?
Additionally, in one of the columns I'd like to display an "edit" link. I've got the extra columns coming back fine from the initial page load. But where I had explicitly put "Edit" in the markup... that "Edit" is gone. Also, I'd need to pass the id of the record in the edit link. How would that value be available?
Thanks much!
Charlie
I've implemented DataTables a few times, but doing it for the first time via AJAX. I've finally gotten it to the point where it's doing its initial data load (yay, me). Have a couple of questions moving forward...
I had a checkbox in place before that would display inactive records (they're not returned by default). We've got a column in the database table (isActive), and checking this checkbox and hitting "search" button would display all records (inactives included). Can I implement something similar via AJAX?
What happens so far is the page is loaded with only active records. On checking the checkbox, I'd like to trigger a refresh of the data so that inactive records are loaded as well. Any pointers?
Additionally, in one of the columns I'd like to display an "edit" link. I've got the extra columns coming back fine from the initial page load. But where I had explicitly put "Edit" in the markup... that "Edit" is gone. Also, I'd need to pass the id of the record in the edit link. How would that value be available?
Thanks much!
Charlie
This discussion has been closed.
Replies
Make your jQuery call and do something like this with your results: http://datatables.net/release-datatables/examples/api/add_row.html
I don't understand the first part of your last question, you passed column saying Edit and that 'Edit' is gone? Humm..?
About the icon and the id. If you pass a column named DT_RowId containing your id, DataTables will associate it to the he tr (such as tr id=1, ie)