mardi 5 mars 2019

Bootstrap table item selection

I use bootstrap table in my fronten. This is my code:

<table id="table" 
data-click-to-select="true">
    <thead>
        <tr>
            <th data-field="time">Time</th>
            <th data-field="lgt">Longitude</th>
            <th data-field="lat">Latitude</th>
            <th data-field="note">Note</th>
        </tr>
    </thead>
</table>

<script>
    var $table = $('#table');
    var data = <%- JSON.stringify(data) %>;
    $(function () {
        $('#table').bootstrapTable({ data: data});
    });
</script>

It shows data, but it does not show check boxes for item selection. It looks like data-click-to-select="true" does not work. Where is a problem and how to fix it? I was also thinking about to use data-toggle="table", but I don't know how to use it with my data from <%- JSON.stringify(data) %>;. Thank you for any help.




Aucun commentaire:

Enregistrer un commentaire