Normal Table
Basic example of the paginator function.
A table and a place to put the page link are passed to it, as well as a class to style the current page's button.
Code:
paginator({
table: document.getElementById("table_box_native").getElementsByTagName("table")[0],
box: document.getElementById("index_native"),
active_class: "color_page"
});
Table with Bootstrap Pagination
This changes things up a bit by using a different box mode, and not providing a box to put the page buttons in.
setting the box mode to "list" builds the page buttons to use Bootstrap's pagination.
The paginator function returns the box element with the page buttons and let's the programmer place it.
Catching and placing the box element isn't needed if a box element is provided in the configuration object
Code:
var box = paginator({
table: document.getElementById("table_box_bootstrap").getElementsByTagName("table")[0],
box_mode: "list",
});
box.className = "box";
document.getElementById("table_box_bootstrap").appendChild(box);
List
Instead of paginating a table, this example provides it's own function for getting the "rows" to be paginated.
Normally the paginator function accepts a table object and figures things out for itself.
Because you can provide your own selector function, the paginator function is thus capable of paginating anything you can select.
- On Becoming a Person: A Therapist's View of Psychotherapy
- Psychoanalysis and Religion
- The Farther Reaches of Human Nature
- What Life Should Mean to You
- Walden Two
- Childhood and Society
- The Doctor and The Soul: An Introduction to Logotherapy
- Our Inner Conflicts: A Constructive Theory of Neurosis
- Cognitive therapy and the emotional disorders
- Humanistic Psychotherapy: The Rational-Emotive Approach
- The Basic Writings of Sigmund Freud
- I Ching, The Oracle of the Cosmic Way
- Baboon Mothers and Infants
- The Autobiography of Charles Darwin: 1809-1882
- A sacred unity: Further steps to an ecology of mind
- Life Cycles: Reflections of an Evolutionary Biologist
- Family Evaluation: An Approach Based on Bowen Theory
- A Secure Base
- The Integrative Neurobiology of Affiliation
- Psychobiology of reptilian reproduction
- Descartes Error: Emotion, Reason and the Human Brain
- Homicide
- On the Origin of Species
- The Descent of Man
- Out of the Crisis
- Good Natured
- Ideas And Opinions
- Time Frames:The Evolution of Punctuated Equilibria
- Shot in the Heart
- Emotional Intelligence: Why It Can Matter More Than IQ
- The Chimpanzees of Gombe: Patterns of Behavior
- Why males exist: An inquiry into the evolution of sex
- The Roots of Human Behavior
- Sacred Hoops: Spiritual Lessons of a Hardwood Warrior
- The Possible and the Actual
- The Undiscovered Self
- Out of Control
- The Emotional Brain
- Families and Family Therapy
- Will Therapy and Truth and Reality
- Sex and Friendship in Baboons
- The Alchemy of Finance
- Lives of a Cell: Notes of a Biology Watcher
- The Holy Bible: King James Version
- The Battered Women
- The Beak of the Finch: A Story of Evolution in Our Time
- Beyond Natural Selection
- The Moral Sense
- Anna Freud: A Biography
Code:
paginator({
get_rows: function () {
return document.getElementById("list").getElementsByTagName("li");
},
box: document.getElementById("list_index"),
active_class: "color_page"
});