Define column headers with ajax
Define column headers with ajax

I currently have an AJAX file that feeds in the data to my table but I also want to define the tables in the ajax page. How would this be possible?. Alternatively, could I destroy two columns from my table from the ajax page?
Thanks for the help,
Toby
This discussion has been closed.
Answers
Hi @TobyDS ,
We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.
Cheers,
Colin
Thanks @colin ,
So for example I have a table with 5 table headers: Name, Year, Michelmas Sport, Lent Sport and Summer Sport. These are defined on my index.php page as such:
However the data in my table is posted using the in built data function. code for my datatable function is bellow
Because I am using filter to filter for things like term I want to remove the rows for the other terms when I use that filter. So if I filter for summer term the colums for michelmass and lent will disappear. So is there a way to post the colums from the ajax page so that I can define them based on the term posted to that page.
Here is an example I've posted in other threads:
http://live.datatables.net/huyexejo/1/edit
You will need to remove
ajax
from the Datatables init code and use jQuery's ajax. The reason is that the column information needs to be built before initialization of Datatables.Kevin
@kthorngren that makes sense but I have no clue how to get that working especially considering I have to pass data from forms and whenever the forms are selected resubmit the ajax request. This is what I tried but I'm not even getting a request sent through: