Select a certain table row based on GET parameter of page
Select a certain table row based on GET parameter of page
nessinits
Posts: 86Questions: 27Answers: 0
Hi,
This probably very easy, but I can't find the right info to make this work.
I want to select a certain row of my datatables based on the value of a GET parameter given to the page.
getting the parameter is easy:
var <parameter> = url.searchParams.get("<parameter>")
But how do I use this value to find a specific row in my datatable and when/how do I fire the right event?
Kind regards,
nessinits
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Use the
row().select()
method to select the row (assuming you are using the Select extension). You would call that once the table has been created and populated with data.Allan
Thanks Allan,
You said: "You would call that once the table has been created and populated with data."
My question is exactly that. I believe that on InitComplete the datatable isn't populated yet. So when is it populated (I use ajax to populate the datatable)?
Kind regards and thanks for all your help,
nessinits
It should be when
initComplete
is triggered - that's the whole point of that callback!From the documentation for that option:
Allan