使用 Tabulator 分页所需的页面

编程入门 行业动态 更新时间:2024-10-08 14:37:56
本文介绍了使用 Tabulator 分页所需的页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我正在使用 Tabulator,我需要添加将您带到所需页面的输入框.如果您有 10 页并且想要转到第 9 页,则只需输入 9 并按 Enter.此功能在数据表中可用,这里是一个示例那么如何用 Tabulator 做到这一点呢?谢谢

I am using Tabulator, I need to add input box that takes you to a desired page. If you have 10 pages and you want to go to page 9 you would just input 9 and hit enter. This feature is available in DataTables here is an example so how to do this with Tabulator? thank you

推荐答案

http://tabulator.info/docs/4.6/page#manage

您需要使用 table.setPage(x) 函数,其中 table 是您的 Tabulator 实例,x 是您想要转到的页码.

You would need to use the table.setPage(x) function where table is your Tabulator instance and x is the page number you want to go to.

这里有一个示例,说明事件侦听器函数在您的元素之一上的样子.

So here is an example of what the event listener function would look like on one of your elements.

function pageListener(event){
  if (isNaN(event.target.value)){
    // We don't want anything that isn't a number.
    return;
  }
  // Assuming that 'table' is a variable containing the
  // Tabulator instance
  table.setPage(Number(event.target.value));
}

这是一个工作示例.https://jsfiddle/nrayburn/fewqhuar/1/

这篇关于使用 Tabulator 分页所需的页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-05-01 10:44:01,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1408618.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:所需   分页   页面   Tabulator

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!