Access to specific datatable attribute

Access to specific datatable attribute

nizarmahrougnizarmahroug Posts: 3Questions: 1Answers: 0

Hello everybody,
How i can get this attribute

Answers

  • kthorngrenkthorngren Posts: 20,275Questions: 26Answers: 4,765
    edited January 2020

    When and how do you want to use it?

    Some init option callbacks like initComplete can provide the JSON data. You can use ajax.json() to get the JSON data.

    If this doesn't help please provide more details of what you are trying to do.

    Kevin

  • nizarmahrougnizarmahroug Posts: 3Questions: 1Answers: 0
    edited January 2020

    Hi @kthorngren thank you for answers.
    When i get the response from server for my dataTable , i set this attribute like this :

    $output = array(
    "draw" => $_POST['draw'],
    "recordsTotal" => $this->Items_model->count_all(),
    "recordsFiltered" => $this->Items_model->count_filtered(),
    "data" => $data,
    "producers_ids" => $total_producers_ids
    );
    echo json_encode($output);

    whatever I will use it a parameter for an script php (specific excel export with phpExcel library , checkbox in dataTable to choice which rows to export after filter)

  • kthorngrenkthorngren Posts: 20,275Questions: 26Answers: 4,765

    Sorry, I had a type in the ajax.json() above. Use this API to get the producers_ids values when you want to use them.

    Kevin

  • nizarmahrougnizarmahroug Posts: 3Questions: 1Answers: 0

    Okay thanks, I will try it

This discussion has been closed.