sorttable.js

Why AJAX response is not in sortable manner

随声附和 提交于 2020-01-06 08:52:12
问题 I am using sorttable.js for table sorting and my table is updated in every 3 sec by ajax response but the response is not in sorted manner as i expect it to be. Index page <div id="resDiv"> <table id="myTable1" class="sortable"> <thead> <tr><th id="person">Person</th><th id="monpay">Monthly pay</th></tr> </thead> <tbody> <tr><td>Jan Molby</td><td>£12,000</td></tr> <tr><td>Steve Nicol</td><td>£8,500</td></tr> <tr><td>Steve McMahon</td><td>£9,200</td></tr> <tr><td>John Barnes</td><td>£15,300<

Why AJAX response is not in sortable manner

三世轮回 提交于 2020-01-06 08:52:07
问题 I am using sorttable.js for table sorting and my table is updated in every 3 sec by ajax response but the response is not in sorted manner as i expect it to be. Index page <div id="resDiv"> <table id="myTable1" class="sortable"> <thead> <tr><th id="person">Person</th><th id="monpay">Monthly pay</th></tr> </thead> <tbody> <tr><td>Jan Molby</td><td>£12,000</td></tr> <tr><td>Steve Nicol</td><td>£8,500</td></tr> <tr><td>Steve McMahon</td><td>£9,200</td></tr> <tr><td>John Barnes</td><td>£15,300<

How to enable `sorttable.js` on Rails4 with turbolinks

烂漫一生 提交于 2019-12-08 03:50:47
问题 Rails 4.2.0, turbolinks (2.5.3) jquery-rails (4.0.3), jquery-ui-rails (5.0.3) sorttable.js App used on Chrome, Firefox, and IE WHAT SHOULD HAPPEN : Whether a redirect, render, or just clicking to a new page in the app, any table with class sorttable (I edited it in the original JS) should be sortable by column heading. WHAT ACTUALLY HAPPENS : I am on a contacts page. I hit refresh, and logger statements in the JS appear. The plugin works as expected. If I navigate to Home, then back to

Auto sort the table using sorttable.js

独自空忆成欢 提交于 2019-12-07 05:55:31
问题 I am trying to use this script to sort the html table: http://www.kryogenix.org/code/browser/sorttable/ JS code itself: http://www.kryogenix.org/code/browser/sorttable/sorttable.js I used the customkey option and it works when I click the heading. I would like to auto sort based on that customkey when the page loads. How can I do that? I want to use this specific script. I tried window.onload but with no luck. 回答1: After loading the page just trigger a click on the header column you want to