Using language without triggering draw.dt event

Using language without triggering draw.dt event

robertroidrobertroid Posts: 1Questions: 0Answers: 0

Hi, I have the following problem:
I have a table with forms inside, that I fill manually once the ajax request succeeds. As when changing pages or row number makes new form inputs, I have to fill them with the previous data on a draw.dt event too.

I have to maintain 2 languages (english and japanese), so when jp page loads, I add the language request to datatable properties. The problem is that on the japanese page, after language json arrives, it triggers a draw.dt event too, but since data is not ready yet it throws an error.

Is there a way to prevent using another language to trigger a dt.draw event?
Thanks.

Replies

  • allanallan Posts: 63,455Questions: 1Answers: 10,465 Site admin

    Try adding your draw event inside a init event. That will delay the listening of the draw until after the table is fully initialised (and the language loaded).

    Allan

This discussion has been closed.