Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

95
Views
prevent deselect when click selected row in bootstrap table

I have a webapp in HTML5, using bootstrap table. I have set "data-click-to-select="true" to check the checkbox when select the row.

But when click some dropdown to box in this row, the check box become unselected.

How to prevent the unselect event when click the selected row?

<table contenteditable='true' class="table table-bordered table-sm" width="100%" cellspacing="0" style="font-size: 1.0rem;"
                   id="bk-table"

                   data-click-to-select="true"
                  <tr >
 
                    <th data-field="state" data-checkbox="true"></th>
                    <th data-field="courseCode"  data-formatter="renderCourse">Course Code</th>
<th  data-field="book.Distribution_platform" data-formatter="renderMode">Distribution Mode</th>
         ...
                </tr>
                </thead>
</table>
<script>
        function renderMode(value) {
            return `<select style="width: 7em"class ='Distribution_platform' name="Distribution_platform" id="Distribution_platform">
            <option value="" ${(value === '') ? 'selected="selected"' : ""}>--Select--</option>
            <option value="Canvas" ${(value === 'Canvas') ? 'selected="selected"' : ""}>Canvas</option>
            <option value="Main Distribution" ${(value === 'Main Distribution') ? 'selected="selected"' : ""}>Main Distribution</option>
        </select>`
        }

</script>

I have tried:

          function ignoreClickToSelectOn(e) {
    return ['A', 'BUTTON', 'LABEL', 'SELECTION'].indexOf(e.tagName) > -1
  }

  $(function() {
    $('#bk-table').bootstrapTable({
      ignoreClickToSelectOn: ignoreClickToSelectOn
    })
  });

          $('#bk-table').on('click-row.bs.table', function (event, row) 
     {

        event.stopImmediatePropagation();
        event.stopPropagation();
        event.preventDefault();

    });

But these all could not prevent the uncheck event of the checkbox.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!