Redirect and open edit dialog

Redirect and open edit dialog

agiladminagiladmin Posts: 7Questions: 5Answers: 0

Is it possible to redirect to a datatable page, say with window.location.href and at the same time open the edit dialog of a specific datatables entry at the same time? given that I have the id of the row?

Answers

  • allanallan Posts: 63,685Questions: 1Answers: 10,498 Site admin

    It certainly should be - use page() to change the DataTable page and edit() to trigger editing on the row.

    Allan

  • agiladminagiladmin Posts: 7Questions: 5Answers: 0

    I meant that I am coming from a completely different site but I want to open a site in which the datatable is in it (which worked out), I pass on a parameter (the id of an entry) to trigger the edit dialog. Can I open an edit dialog of a specific id? I tried it with an edit() example to just open the first row just when the site gets loaded but get the error TypeError: a is undefined of datatables.min.js. Could it be possible that the site hasnt loaded yet and it wants to open the dialog?

  • allanallan Posts: 63,685Questions: 1Answers: 10,498 Site admin

    Thanks for the confirmation. I think I understood correctly. You need to use the Editor edit() method to trigger editing on the row you want. There isn't a built in way of doing it, but a couple of lines of code using the API should do it.

    Regarding the error, it is possible that it is being called to early - I'm not sure. Can you link to the page please?

    Allan

This discussion has been closed.