Search code examples
jquerybootstrap-4bootstrap-table

How i can add some HTML code on bootstrap table with filter control


I have this bootstrap table https://codepen.io/AurelieT/pen/JGxMgo

but when i try add sone button on td the filter mode change that html code and convert to text

i post here the result i got it https://i.sstatic.net/eKUfd.png

<table id="table"
         data-toggle="table"
         data-search="false"
         data-filter-control="true"
         data-show-export="true"
         data-click-to-select="false"
         data-toolbar="#toolbar">

<thead>
    <tr>
        <th data-field="state" data-checkbox="true"></th>
        <th data-field="Empleado" data-filter-control="input" data-sortable="true">Empleado</th>
    <th data-field="Datos" data-filter-control="false" data-sortable="false">Ver Datos</th>
        <th data-field="Estado" data-filter-control="select" data-sortable="true">Estado Datos</th>
        <th data-field="Revisados" data-filter-control="select" data-sortable="true">Revisado</th>
    </tr>
</thead>
<tbody>
    <tr>
        <td class="bs-checkbox "><input data-index="0" name="btSelectItem" type="checkbox"></td>
        <td>Valérie</td>
        <td>
      <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModalCenter">
        Ver Datos
      </button>
    </td>
        <td>Rojo</td>
    <td>Si</td>
    </tr>

</tbody></table>

I tried change the filters but dint work

I just need show the button correctly,


Solution

  • Just add data-escape="false" to your table settings and it will work.