Eitanmg
Eitanmg

Reputation: 586

Button click not triggered if using bootstrap-table pagination / search

i'm using wenzhixin bootstrap-table, and when i'm loading the page for the first time the button click is triggered, but after paginate through the table (using bootstrap-table features, the click is no longer triggered.

a sample code is at: https://jsfiddle.net/eitanmg/gsxb8645/9/

how can i get my button click triggered along with using bootstrap-table search / pagination features?

Upvotes: 1

Views: 1353

Answers (3)

Ram Singh
Ram Singh

Reputation: 6928

You can do as below:

$(document).ready(function () {
    $("table").on('click', '.done_status', function () {
        alert("hello!");
      });
 });

Upvotes: 0

Ozal  Zarbaliyev
Ozal Zarbaliyev

Reputation: 638

I edited your code at jsfiddle it works now with following edit.

$("table").on('click', '.done_status',function () {

    alert("hello!");

}); 

Upvotes: 1

SRK
SRK

Reputation: 3496

$(document).ready(function () {
    $(document).on("click",".done_status",function () {

    alert("hello!");

    });
});

You need to bind the click event on the button so it can get detected by DOM.

Here is a fiddle

Upvotes: 4

Related Questions