Problem with checkbox button

Problem with checkbox button

NiketesNiketes Posts: 4Questions: 3Answers: 0

Hy guys.

I have to add on my table results a column where, for every row, there is a checkbox button to click.
I've read on this site and others how to add the classic checkbox button and this works with no problems. I want to try to add a more rich button and, cause I'm using Bootstrap, I've searched oh the web. I've found the Bootstrap option for checkbuttons and it works; but, in my search, I found an interesting option with the Glyphicons, this: https://bootsnipp.com/snippets/6o0P

So I've tried to use this one for my app but I've encountered some problems. At start, I've tried the "classic" way, i.e. include the JS code of the above link both in an external file to import in the page that use the table and directly inside the js file with my Data Table. This options does not works: My button appear grey and clicking on it does not give results (the button remain grey and not selected).

Then, cause my table is showed after a form interaction, I've moved the code to the page where the submit button for this form is defined, so actually my file have this function:

$(function() {
      $('#scansearchform').submit(function(){
           //1. Js code of the above link
                   //2. code to show the table
}

With this, there is a little change: the button appear initially with a color and after a few sec, become grey and with problems of the previous solution.

It seems reasonable to suppose that the problem is where the JS code of the above link must be putted; so, where I may put it?

Answers

This discussion has been closed.