Select a certain table row based on GET parameter of page

Select a certain table row based on GET parameter of page

nessinitsnessinits 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

Answers

  • allanallan Posts: 61,740Questions: 1Answers: 10,111 Site admin

    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

  • nessinitsnessinits Posts: 86Questions: 27Answers: 0

    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

  • allanallan Posts: 61,740Questions: 1Answers: 10,111 Site admin
    Answer ✓

    It should be when initComplete is triggered - that's the whole point of that callback!

    From the documentation for that option:

    It can often be useful to know when your table has fully been initialised, data loaded and drawn

    Allan

This discussion has been closed.