Welcome Guest, Not a member yet? Register   Sign In
Dompdf
#1

[eluser]reidz[/eluser]
Hi, now i'm working with CI and dompdf, but i found problem with how to send some variables to controller function which called dompdf helper

I just cant use Ajax $.post or $.get, any of those variables i sent with that way just wont work, here some of my code
Code:
function getPrint() // my JQuery Function to called function in Controller
{ $.get("/qa/dl_task/printDOMPDF", { 'task_id': '01'} ); }

and here is my code in controller to called dompdf helper
Code:
function printDOMPDF()
    {
        $task_id = $this->input->post('task_id');
        $data['info']="<h1>$task_id</h1>";
        $html = $this->load->view('/qa/to_pdf/dl_task_pdf', $data, TRUE);
        pdf_create($html, 'untitled');
    }

with this way nothing happened but its different if i use this javascript to called that function
Code:
function getPrint()
{location.href= '/qa/dl_task/printDOMPDF';}
its working with this javascript and with same controller function printDOMPDF above, but i want to send some post variable to printDOMPDF because i want do some query before i print the html

can anyone correct and help me ?? any help will be apreciated thanks
#2

[eluser]reidz[/eluser]
answered, using parameter in javascript caller, done




Theme © iAndrew 2016 - Forum software by © MyBB