Calling .draw with additional custom parameter

Calling .draw with additional custom parameter

StefanRStefanR Posts: 12Questions: 2Answers: 2

Hi there,
we're using serverside processing on some large datasets. We have a situation where when a user clicks a button we need to know all the record ids of all the iTotalDisplayRecords (not just those currently visible).

My idea was to call .draw on the Datatable but send along an additional parameter when that button click happens.

My question: how to 'intercept' the call the Datatable makes after I call .draw?
I want to send an additional form variable along with columns[0][data] and all the others.

Doable?

Replies

  • allanallan Posts: 64,493Questions: 1Answers: 10,656 Site admin

    Use the preXhr event to intercept the Ajax call and modify the data.

    Or if it is something you know you want to do every single time the request is made, use ajax.data as a function to modify the data.

    Allan

  • StefanRStefanR Posts: 12Questions: 2Answers: 2

    Nice one, I think preXhr is what I need. Will try and report back.

This discussion has been closed.