All Projects → chniter → Bstreeview

chniter / Bstreeview

Licence: apache-2.0
Bootstrap Treeview, A very simple plugin to build a basic and elegant Treeview with bootstrap 4. See the demo:

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Bstreeview

GraphView
Android GraphView is used to display data in graph structures.
Stars: ✭ 952 (+209.09%)
Mutual labels:  tree-structure, treeview
Laravel Form Components
A set of Blade components to rapidly build forms with Tailwind CSS (v1.0 and v2.0) and Bootstrap 4. Supports validation, model binding, default values, translations, Laravel Livewire, includes default vendor styling and fully customizable!
Stars: ✭ 295 (-4.22%)
Mutual labels:  bootstrap, bootstrap4
Coreui Free Vue Admin Template
Open source admin template based on Bootstrap 5 and Vue 3
Stars: ✭ 2,951 (+858.12%)
Mutual labels:  bootstrap, bootstrap4
react-folder-tree
A versatile react treeview library that supports custom icons and event handlers
Stars: ✭ 56 (-81.82%)
Mutual labels:  tree-structure, treeview
E107
e107 Bootstrap CMS (Content Management System) v2 with PHP, MySQL, HTML5, jQuery and Twitter Bootstrap. Issue Discussion Room: https://gitter.im/e107inc/e107
Stars: ✭ 272 (-11.69%)
Mutual labels:  bootstrap, bootstrap4
react-treefold
A renderless tree component for your hierarchical React views
Stars: ✭ 37 (-87.99%)
Mutual labels:  tree-structure, treeview
Bs Stepper
A stepper for Bootstrap 4.x
Stars: ✭ 261 (-15.26%)
Mutual labels:  bootstrap, bootstrap4
Graphview
Flutter GraphView is used to display data in graph structures. It can display Tree layout, Directed and Layered graph. Useful for Family Tree, Hierarchy View.
Stars: ✭ 152 (-50.65%)
Mutual labels:  tree-structure, treeview
Modular Admin Html
ModularAdmin - Free Dashboard Theme Built On Bootstrap 4 | HTML Version
Stars: ✭ 2,875 (+833.44%)
Mutual labels:  bootstrap, bootstrap4
Startbootstrap Business Casual
A Bootstrap HTML theme for business websites - created by Start Bootstrap
Stars: ✭ 266 (-13.64%)
Mutual labels:  bootstrap, bootstrap4
react-tree
Hierarchical tree component for React in Typescript
Stars: ✭ 174 (-43.51%)
Mutual labels:  tree-structure, treeview
Blazor
DevExpress UI for Blazor
Stars: ✭ 274 (-11.04%)
Mutual labels:  bootstrap, bootstrap4
Unity-IMGUI-TreeView
Simple Tree View implementation for IMGUI (Editor GUI) in Unity. Includes a special type for working with asset paths, but base data structure and view can be easily extended to support anything.
Stars: ✭ 73 (-76.3%)
Mutual labels:  tree-structure, treeview
Perfect-Server-Side-Swift iOS-App
A family tree API server implementation with iOS client. Server has been implemented with Perfect: Server-Side Swift And iOS client is in pure Swift.
Stars: ✭ 15 (-95.13%)
Mutual labels:  tree-structure, treeview
vue-virtualised
Blazing fast scrolling and updating for any amount of list and hierarchical data.
Stars: ✭ 18 (-94.16%)
Mutual labels:  tree-structure, treeview
Startbootstrap Shop Homepage
A shop homepage Bootstrap HTML template created by Start Bootstrap
Stars: ✭ 261 (-15.26%)
Mutual labels:  bootstrap, bootstrap4
Graphview
Android GraphView is used to display data in graph structures.
Stars: ✭ 918 (+198.05%)
Mutual labels:  tree-structure, treeview
Pbtreeview
An UITreeView implementation from UITableView that Apple missed in its UIKit framework. And it is in pure Swift.
Stars: ✭ 128 (-58.44%)
Mutual labels:  tree-structure, treeview
Ajsf
Angular JSON Schema Form
Stars: ✭ 266 (-13.64%)
Mutual labels:  bootstrap, bootstrap4
Bootstrapadmin
Bootstrap 4 admin template.
Stars: ✭ 273 (-11.36%)
Mutual labels:  bootstrap, bootstrap4

Bootstrap 4 Tree View


npm version

A very simple plugin to build a basic and elegant Treeview with boostrap 4.

Bootstrap Tree View Default

Dependencies

Where provided these are the actual versions bootstrap-treeview has been tested against.

Getting Started

Install

You can install using npm (recommended):

$ npm install bstreeview

or download manually.

Usage

Add the following resources for the bootstrap-treeview to function correctly.

<!-- Required Stylesheets -->
<link href="bootstrap.css" rel="stylesheet">

<!-- Required Javascript -->
<script src="jquery.js"></script>
<script src="bstreeview.js"></script>

The component will bind to any existing DOM element.

<div id="tree"></div>

Basic usage may look something like this.

function getTree() {
  // Some logic to retrieve, or generate tree structure
  return data;
}

$('#tree').bstreeview({ data: getTree() });

Data Structure

In order to define the hierarchical structure needed for the tree it's necessary to provide a nested array of JavaScript objects.

Example

var tree = [
  {
    text: "Node 1",
    icon: "fa fa-folder",
    nodes: [
      {
        text: "Sub Node 1",
        icon: "fa fa-folder",
        nodes: [
          {
            id:    "sub-node-1",
            text:  "Sub Child Node 1",
            icon:  "fa fa-folder",
            class: "nav-level-3",
            href:  "https://google.com"
          },
          {
            text: "Sub Child Node 2",
            icon: "fa fa-folder"
          }
        ]
      },
      {
        text: "Sub Node 2",
         icon: "fa fa-folder"
      }
    ]
  },
  {
    text: "Node 2",
    icon: "fa fa-folder"
  },
  {
    text: "Node 3",
    icon: "fa fa-folder"
  },
  {
    text: "Node 4",
    icon: "fa fa-folder"
  },
  {
    text: "Node 5",
    icon: "fa fa-folder"
  }
];

This property text is required to display nodes.

{
  text: "Node 1"
}

Node Properties

text

String Mandatory

The text value displayed for a given tree node.

icon

String Optional

The icon displayed on a given node.

href

String Optional

A custom href attribute value for a given node.

class

String Optional

A class name or space separated list of class names to add to a given node.

id

String Optional

ID attribute value to assign to a given node.

Options

data

String Mandatory

Json or string array of nodes.

expandIcon

String Optional

Expand icon class name, default is fa fa-angle-down fa-fw.

collapseIcon

String Optional

Collapse icon class name, default is fa fa-angle-right fa-fw.

indent

number with decimals Optional

Custom indent between node levels (rem), default is 1.25.

parentsMarginLeft

String Optional

margin-left value of parent nodes, default is 1.25rem.

openNodeLinkOnNewTab

Boolean Optional

Open node link on new browser Tab, default is true.

// Example: initializing the bstreeview
$('#tree').bstreeview({
  data: data,
  expandIcon: 'fa fa-angle-down fa-fw',
  collapseIcon: 'fa fa-angle-right fa-fw',
  indent: 1.25,
  parentsMarginLeft: '1.25rem',
  openNodeLinkOnNewTab: true
});

Methods

Events

Copyright and Licensing

Copyright 2020 Sami CHNITER

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].