Search code examples
javascriptpaginationlistjs

Paging a <li> with javascript not working?


I'm trying to get this paging plugin to activate correctly in on my website: http://listjs.com/examples/paging.html. It's active but not functioning right, it's only showing 3 list results and no navigation for going to the next page. You can see it here: http://bluebeam.com/us/support/articles/list.asp

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
<script type="text/javascript">

    /*
    * LOVELY THINGS
    */
    var options = {
        valueNames: [ 'name', 'description', 'category' ],
        page: 3,
        plugins: [ [ 'paging' , {
                innerWindow: 1,
                left: 2,
                right: 3} ] ]
    };

    var featureList = new List('support-articles', options);

    $('#filter-install').click(function() {
        featureList.filter(function(item) {
            if (item.values().category == "Common Solutions") {
                return true;
            } else {
                return false;
            }
        });
        return false;
    });

    $('#filter-revu').click(function() {
        featureList.filter(function(item) {
            if (item.values().category == "Revu") {
                return true;
            } else {
                return false;
            }
        });
        return false;
    });

    $('#filter-plugins').click(function() {
        featureList.filter(function(item) {
            if (item.values().category == "Plug-ins") {
                return true;
            } else {
                return false;
            }
        });
        return false;
    });

    $('#filter-printer').click(function() {
        featureList.filter(function(item) {
            if (item.values().category == "PDF Printer") {
                return true;
            } else {
                return false;
            }
        });
        return false;
    });

    $('#filter-admin').click(function() {
        featureList.filter(function(item) {
            if (item.values().category == "Administrator") {
                return true;
            } else {
                return false;
            }
        });
        return false;
    });
    $('#filter-3rd-party').click(function() {
        featureList.filter(function(item) {
            if (item.values().category == "3rd Party") {
                return true;
            } else {
                return false;
            }
        });
        return false;
    });
    $('#filter-video').click(function() {
        featureList.filter(function(item) {
            if (item.values().name == "Video") {
                return true;
            } else {
                return false;
            }
        });
        return false;
    });
    $('#filter-article').click(function() {
        featureList.filter(function(item) {
            if (item.values().name == "Article") {
                return true;
            } else {
                return false;
            }
        });
        return false;
    });
    $('#filter-none').click(function() {
        featureList.filter();
        return false;
    });


</script>

What am I doing wrong?


Solution

  • I was missing a <ul class="paging"></ul> inside my container div.