jquery - Refresh datatable while adding new parameter -


I have a search screen where the user realizes what data has been retrieved for the report. The parameters are taken to the datatable and then the report is retrieved through AJAX.

The URL used for AJAX loads may be something like report.php? Batch = 1 & amp; Id = 5 .

What I want to do is provide a link that will allow the user to download the results of the report. To do so, I want to submit the same request on the server, but then I will only send the view to CSV instead of HTML. To do this, I want to add an extra variable to the URL, so it's called report.php? Batch = 1 & amp; id = 5 & amp; Output = download comes out with something like <. P> I have tried to give some approval to add that variables, which are both without success FYI, I have assigned the dateable configuration to a variables named FixHeader.

1) Set the value with fnServerParams. fixTheHeader.push ({"Output": "Downloads"}); and then fixTheHeader.fnReloadAjax (); Reload the table with . Although no error was generated, but it did not even add variables in the URL.

2) Retrieve the url set as ajax source url

  $ source ($$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ Find parent (". DataTables_wrapper") ("Table: First"). DataTable () fnSettings (). oInit.sAjaxSource;   

then and & nbsp; Add output = download to source and redirect the window. The issue with this approach was that ? Batch = 1 & amp; ID = 5 was no longer a part of the URL.

From what perspective i do this, is there a way within datatable to get url + variable, to add additional variable, and then again on the server without reloading a page Submit? I do not want to hardcode this URL with parameters because I want this same code to be used for many reports. I hope this makes sense.

I am using current version (1.9.4) datatables ()

> < p> You can add download links (CSV, PDF) in any data using the additional.

Initial example with tablets:

  $ ('# example'). DataTable ({"sDom": 'T & lt; "clear"> lfrtip', "oTableTools": {"sSwfPath": "/swf/copy_csv_xls_pdf.swf"}});    

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -