javascriptjquerypaginationfancytree

Is it possible to pagination on fancytree?


Right now I have to render a lot of documents on the same page and I am using francytree

Issue: Performance

MY Thinking : Is fancytree provide a pagination functionality or not?


Solution

  • No. There is no buit-in pagination option available as of June, 2019.

    You will have to do it manually by making chunks of your input data and assign them to the tree one at a time.

    However, the tree supports lazy loading. This is more of pagination for a tree.

     $("#tree").fancytree({
        // Initial node data that sets 'lazy' flag on some leaf nodes
        source: [
          {title: "Child 1", key: "1", lazy: true},
          {title: "Folder 2", key: "2", folder: true, lazy: true}
        ],
        lazyLoad: function(event, data) {
          var node = data.node;
          // Issue an Ajax request to load child nodes
          data.result = {
            url: "/getBranchData",
            data: {key: node.key}
          }
        }
      });