diff --git a/pagination/bootstrap_input.js b/pagination/bootstrap_input.js new file mode 100644 index 0000000..abbe683 --- /dev/null +++ b/pagination/bootstrap_input.js @@ -0,0 +1,42 @@ +/** + * Plug-in offers the same functionality as `default` pagination type + * (see `pagingType` option) but with input field for jumping pages, for use with bootstrap theme. + * + * @example + * $(document).ready(function() { + * $('#example').dataTable( { + * "pagingType": "bootstrap_input" + * } ); + * } ); + */ + +$.fn.DataTable.ext.pager.bootstrap_input = function (page, pages) { + return ['first', 'previous', 'input', 'next', 'last']; +}; + + +main_pageButtonFunc = $.fn.DataTable.ext.renderer.pageButton.bootstrap + +$.fn.DataTable.ext.renderer.pageButton = $.extend(true, $.fn.DataTable.ext.renderer.pageButton, + { + bootstrap: function (settings, host, idx, buttons, page, pages) { + main_pageButtonFunc(settings, host, idx, buttons, page, pages); + + input_html = '