Note that there are some explanatory texts on larger screens.

plurals
  1. PONot displaying links
    primarykey
    data
    text
    <p>I'm not sure why but this pagination plugin is NOT displaying the pagelinks and I'm not sure why.</p> <pre><code>(function($) { $.extend({ tablesorterPager: new function() { function updatePageDisplay(c) { var s = $(c.cssPageDisplay,c.container).val((c.page+1) + c.seperator + c.totalPages); } function setPageSize(table,size) { var c = table.config; c.size = size; c.totalPages = Math.ceil(c.totalRows / c.size); c.pagerPositionSet = false; moveToPage(table); fixPosition(table); } function fixPosition(table) { var c = table.config; if(!c.pagerPositionSet &amp;&amp; c.positionFixed) { var c = table.config, o = $(table); if(o.offset) { c.container.css({ top: o.offset().top + o.height() + 'px', position: 'absolute' }); } c.pagerPositionSet = true; } } function moveToFirstPage(table) { var c = table.config; c.page = 0; moveToPage(table); } function moveToLastPage(table) { var c = table.config; c.page = (c.totalPages-1); moveToPage(table); } function moveToNextPage(table) { var c = table.config; c.page++; if(c.page &gt;= (c.totalPages-1)) { c.page = (c.totalPages-1); } moveToPage(table); } function moveToPrevPage(table) { var c = table.config; c.page--; if(c.page &lt;= 0) { c.page = 0; } moveToPage(table); } function moveToPage(table) { var c = table.config; if(c.page &lt; 0 || c.page &gt; (c.totalPages-1)) { c.page = 0; } renderTable(table, c.rowsCopy); } function renderTable(table,rows) { var c = table.config; var l = rows.length; var s = (c.page * c.size); var e = (s + c.size); if(e &gt; rows.length ) { e = rows.length; } if (c.afterPagingCallBack) c.afterPagingCallBack(); var tableBody = $(table.tBodies[0]); // clear the table body $.tablesorter.clearTableBody(table); for(var i = s; i &lt; e; i++) { //tableBody.append(rows[i]); var o = rows[i]; var l = o.length; for(var j=0; j &lt; l; j++) { tableBody[0].appendChild(o[j]); } } fixPosition(table,tableBody); $(table).trigger("applyWidgets"); if( c.page &gt;= c.totalPages ) { moveToLastPage(table); } updatePageDisplay(c); } this.appender = function(table,rows) { var c = table.config; c.rowsCopy = rows; c.totalRows = rows.length; c.totalPages = Math.ceil(c.totalRows / c.size); renderTable(table,rows); }; this.defaults = { size: 1, offset: 0, page: 0, totalRows: 0, totalPages: 0, container: null, cssNext: '.next', cssPrev: '.prev', cssFirst: '.first', cssLast: '.last', cssPageDisplay: '.pagedisplay', cssPageSize: '.pagesize', cssPageLinks: 'a.pageLink', // extension setting seperator: "/", positionFixed: false, // defaulting this to false. original value is true. appender: this.appender, afterPagingCallBack: null }; this.construct = function(settings) { return this.each(function() { config = $.extend(this.config, $.tablesorterPager.defaults, settings); var table = this, pager = config.container; $(this).trigger("appendCache"); var $pageSizeEl = $( ".pagesize", pager ); if( $pageSizeEl.length &gt; 0 ) config.size = parseInt( $pageSizeEl.val() ); $(config.cssFirst,pager).click(function() { moveToFirstPage(table); return false; }); $(config.cssNext,pager).click(function() { moveToNextPage(table); return false; }); $(config.cssPrev,pager).click(function() { moveToPrevPage(table); return false; }); $(config.cssLast,pager).click(function() { moveToLastPage(table); return false; }); $(config.cssPageSize,pager).change(function() { setPageSize(table,parseInt($(this).val())); return false; }); // Extension code $( config.cssPageLinks, pager ).first().parent().addClass( 'current' ); // add the "currently selected" class to the first link $( config.cssPageLinks, pager ).click( function() { var $el = $(this); // Remove the "current" (selected) class from all links, // and then add it to the one that was just clicked. $( config.cssPageLinks, pager ).parent().removeClass( 'current' ); $el.parent().addClass( 'current' ); table.config.page = parseInt( $el.html() ) - 1; moveToPage( table ); return false; } ); }); }; } }); // extend plugin scope $.fn.extend({ tablesorterPager: $.tablesorterPager.construct }); })(jQuery); </code></pre> <p>Here's my actual page.</p> <pre><code>&lt;script type="text/javascript"&gt; $(document).ready(function() { $('#usersPageList').tablesorter().tablesorterPager({container:$('#usersPageList .pagination'),cssPageLinks:'a.pageLink'}); $('a.bt_green').click(function(e) { e.preventDefault(); $('div.right_content').load('forms/addnew/' + $(this).attr('id')); }); $('table tr').click(function() { checkBox = $(this).children('td').children('input[type=checkbox]'); if(checkBox.attr('checked')) checkBox.removeAttr('checked'); else checkBox.attr('checked', 'checked'); }); $('.ask').jConfirmAction(); $('.ask2').jConfirmAction({question : "Are you sure you want to delete all selected user accounts?", yesAnswer : "Yes", cancelAnswer : "No"}); }); &lt;/script&gt; &lt;h2&gt;User Accounts&lt;/h2&gt; &lt;table id="usersPageList" class="rounded-corner"&gt; &lt;thead&gt; &lt;tr&gt; &lt;th scope="col" class="rounded-first"&gt;&lt;/th&gt; &lt;th scope="col" class="rounded"&gt;Name&lt;/th&gt; &lt;th scope="col" class="rounded"&gt;Email Address&lt;/th&gt; &lt;th scope="col" class="rounded"&gt;Username&lt;/th&gt; &lt;th scope="col" class="rounded"&gt;Edit&lt;/th&gt; &lt;th scope="col" class="rounded-last"&gt;Delete&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tfoot&gt; &lt;tr&gt; &lt;td colspan="5" class="rounded-foot-left"&gt;&lt;em&gt;Displays all of the registered and verified users!&lt;/em&gt;&lt;/td&gt; &lt;td class="rounded-foot-right"&gt;&amp;nbsp;&lt;/td&gt; &lt;/tr&gt; &lt;/tfoot&gt; &lt;tbody&gt; &lt;?php while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) { echo "&lt;tr&gt;"; echo "&lt;td&gt;&lt;input type=\"checkbox\" name=\"users[]\" value=\"".$row['userID']."\"/&gt;&lt;/td&gt;"; echo "&lt;td&gt;".$row['name']."&lt;/td&gt;"; echo "&lt;td&gt;".$row['emailAddress']."&lt;/td&gt;"; echo "&lt;td&gt;".$row['username']."&lt;/td&gt;"; echo "&lt;td&gt;&lt;a href=\"#\"&gt;&lt;img src=\"images/user_edit.png\" alt=\"\" title=\"\" border=\"0\" /&gt;&lt;/a&gt;&lt;/td&gt;"; echo "&lt;td&gt;"; if (($row['userID'] !== '10000') &amp;&amp; ($row['userID'] !== $userID)){ echo "&lt;a href=\"#\" class=\"ask\"&gt;&lt;img src=\"images/trash.png\" class=\"delete\" alt=\"\" title=\"\" border=\"0\" id=\"".$row['userID']."\" /&gt;&lt;/a&gt;"; } echo "&lt;/td&gt;"; echo "&lt;/tr&gt;"; } ?&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;?php addRemove($fileName,$pageName); echo "&lt;div class=\"pagination\"&gt;"; echo "&lt;/div&gt;"; ?&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload