Bootstrap table search function failing once rows have been added to the table.

I have a table that if I attach the bootstrap table options makes the table searchable.
<table data-pagination="true" data-search="true" data-toggle="table">

Open in new window

However, once I add rows to the table dynamically (via javascript) the new content loads fine in the table and is formatted as required, but the search option does not work as the table does not seem to be recognising that the new rows have been added. Indeed, if I use the search, it still searches what were the same records that existed in the table before the new rows were added. It's almost as if the table needs to be refreshed.

I have tried removing the options in the table tag that provide the search etc and dynamically applying them with javascript after the rows have been added.

Open in new window

The console log indicates that the attribute changes have been applied, but the table does not offer the functions.

Having now spent hours experimenting, I am out of ideas, so would be really grateful if someone could shine a light on what might be going wrong?
Who is Participating?
lenamtlConnect With a Mentor Commented:

Bootstrap table provide almost no nothing...

I highly recommend the use of Datatables with responsive option & Yadcf filters.
Don't forget to select Bootstrap version before downloading...

Demo and documentation

martmacAuthor Commented:
Thanks a lot, sorry for the delayed response, have been ill for the past couple of days!!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.