0

Is there any way to disable sorting on a specific row using the bootstrap-table library? The reason is my last row is a "Totals" row and I obviously want that to be the last row in every situation.

http://jsfiddle.net/e3nk137y/11389/

It looks like this functionality is incorporated into this bootstrap-sortable library by setting the data-disable-sorting attribute to true on the <tr> element you want to disable (here). Perhaps it's best to use this library on top of bootstrap-table if this isn't available in bootstrap-table?

1 Answer 1

1

Figured this out. You can't disable sorting on any specific row (at the moment); however, you can add a footer row which locks it in to the bottom most row at all times. You just need to add data-show-footer="true" to the <table> element.

To add values to a column you need to add the data-footer-formatter attribute to the respective <th> element and set that equal to a javascript function, which can be as simple as function myTotal(data){ return '100' }.

You can also style the footer by adding the data-footer-style to the <table> element and, again, setting that equal to a javascript function.

See my answer here for a good, basic example: Is it possible to fix <footer> in bootstraptable?

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.