http://jsfiddle.net/e3nk137y/4537/
<table data-toggle="table"
>
<thead>
<tr>
<th data-field="fruit" data-sortable="true">Item</th>
<th data-field="date" data-sortable="true">Date</th>
<th data-field="type" data-sortable="true">Type</th>
</tr>
</thead>
<tbody>
<tr><td>Pear </td><td data-month="1">January</td> <td>Fruit</td></tr>
<tr><td>Carrot</td><td data-month="3">March</td> <td>Vegetable</td></tr>
<tr><td>Apple </td><td data-month="2">February</td><td>Fruit</td></tr>
</tbody>
</table>
In this fiddle is an example of a table. When you click the header, the table is sorted by the column belonging to that header.
My question is, if it's possible to trigger that function in some other way - from some other function. More generally: can I explicitly call the functions which are called as callbacks from various bootstrap widgets?
You could programatically click the header. Does this achieve what you want?
$("th[data-field='fruit'] .sortable").click();
Fiddle
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With