How to get text input from a column filter?

How to get text input from a column filter?

Shadowstep2003Shadowstep2003 Posts: 1Questions: 1Answers: 0

I have html that creates input boxes on my dataTable for filtering my column.

Everything works great, but when my webpage is refreshed the user input disappears however the dataTable stays filtered (I'm assuming as a result of state save).

I would like to get each columns filtered value to re-populate my input boxes so my users aren't confused on refresh.

console.log(table.columns(1, 2).search() ) gives me an object and I can clearly see the value within the object string. How can I simply get that value to assign it to my html element?

Apologies in advance as I'm still new to HTML and Javascript

For example, I am getting the below but I want to simply get the text "EDI" so I can assign it
Object { 0: "EDI", context: (1) […], length: 1, selector: {…}, tables: g(), table: g(), draw: g(), page: g(), ajax: {…}, rows: g(), … }

Thank you for any help you can provide

Answers

  • colincolin Posts: 15,237Questions: 1Answers: 2,598

    This thread should help, it's asking the same thing.

    Cheers,

    Colin

This discussion has been closed.