drvic10k / bootstrap-sortable

adding sorting ability to bootstrap table
MIT License
513 stars 131 forks source link

Sort not working #94

Closed lcsqlpete closed 8 years ago

lcsqlpete commented 8 years ago

Just downloaded and installed but no sort arrows are appearing in my column headings and clicking on a column does not invoke a sort.

Inside the tag I have: <script src="dist/js/bootstrap-sortable.js"></script> <script src="dist/js/moment.min.js"></script> <link rel="stylesheet" href="dist/css/bootstrap-sortable.css">

There are other js and css files inside the dist folder that are working OK

My <table> tag is:

<table class="table table-striped table-bordered table-condensed sortable">

It has <thead> and <tbody> tags.

The <tbody> html is created by a php script when the page is loaded:

<tbody> <?php include 'memberships-GetList.php'; ?> </tbody>

Could that be what is causing the problem?

drvic10k commented 8 years ago

If your table is created dynamically after the page load, you have to call $.bootstrapSortable(bool); afterwards

lcsqlpete commented 8 years ago

Thanks. Not a js expert so not sure how to do that. Could you give me som eexample code and where it should go in my html file? Pete

drvic10k commented 8 years ago

sorry for late response, did you solve the problem?

I have no experience with php unfortunatelly, co I cannot give you any advice on this issue

lcsqlpete commented 8 years ago

Yes, figured it out. Thanks, Pete