
Security News
The Changelog Podcast: Practical Steps to Stay Safe on npm
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.
org.webjars.npm:github-com-pinguxx-sm-pagination
Advanced tools
Basic pagination for mithril and semantic, it can also be used with bootstrap (3+)
It requires mithril and semantic-ui-menu
Pagination file can be used with any common.js it is expect for mithril to be in global (m variable) or it will attempt to load it with require('mithril'), webpack its recommended

<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/1.10.3/semantic.min.css">
<script src="bower_components/mithril/mithril.js"></script>
<script src="Pagination.js"></script>
</head>
<body>
<script src="test.js"></script>
</body>
</html>
function list(data) {
return m('.ui.segment.sixteen.wide.column', [
m('ul.ui.bulleted.list', data.map(function (item) {
return m('li', {
key: item.id
}, item.name);
}))
]);
}
function table(data) {
return m('.ui.sixteen.wide.column', [
m('table.ui.table', [
m('tbody', data.map(function (item) {
return m('tr', {
key: item.id
}, [
m('td', item.id),
m('td', item.name)
]);
}))
])
]);
}
module.controller = function () {
module.vm.init();
this.pagination = m.component(Pagination, {
data: module.vm.data,
rowsperpage: module.vm.rowsperpage,
pagerender: list,
wrapperclass: 'column'
});
this.paginationCtrl = new this.pagination.controller();
};
module.vm = {};
module.vm.init = function () {
this.data = array;
this.rowsperpage = 10;
this.page = m.prop(3);
};
module.view = function (ctrl) {
return m('.ui.grid.page.one.column', [
m('h1', 'Pagination'),
m.component(Pagination, {
data: module.vm.data,
rowsperpage: module.vm.rowsperpage,
pagerender: list,
wrapperclass: 'column',
page: module.vm.page
}),
m.component(Pagination, {
data: module.vm.data,
rowsperpage: module.vm.rowsperpage,
pagerender: table,
wrapperclass: 'column'
}),
m('.row', [
m('.column', [
m('br')
])
]),
ctrl.pagination.view(ctrl.paginationCtrl),
m('.row', [
m('.column', [
m('button.ui.button', {
onclick: function () {
module.vm.data.splice(30, 10);
ctrl.paginationCtrl.goToPage(4);
module.vm.page(4);
}
}, 'go to page 3')
])
])
]);
};
m.mount(window.document.body, module);
It accepts the following properties
activeiconleft arrow iconright arrow iconicon item,disabledui pagination menu smallTo make it look good with bootstrap just pass the followin classes, tested with bootstrap 3+
classes: {
leftIconClass: 'glyphicon glyphicon-arrow-left',
rightIconClass: 'glyphicon glyphicon-arrow-right'
}
FAQs
WebJar for sm-pagination
We found that org.webjars.npm:github-com-pinguxx-sm-pagination demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.

Security News
Ruby's creator Matz assumes control of RubyGems and Bundler repositories while former maintainers agree to step back and transfer all rights to end the dispute.