You are here

Example of simple jsTree with wholerow select

Submitted by Asif Nowaj, Last Modified on 2019-11-08

This plugin of jsTree enables user to select the node as well as wholerow to make the selection much easier and clear.

You can select the node by clicking anywhere in the row. So the selection of a node is not restricted by clicking on node text. FInd below image.

jsTree with wholerow select

Code snippet is as below. You need to include "wholerow" plugin that's all.

<!DOCTYPE html>
<html lang="en" xmlns="">
    <meta charset="utf-8" />
    <title>Simple jsTree with wholerow selection</title>
    <link rel="stylesheet" href="" />
    <script src=""></script>
    <script src=""></script>
    <script type="text/javascript">
        $(function () {

            var jsondata = [
                           { "id": "ajson1", "parent": "#", "text": "Simple root node" },
                           { "id": "ajson2", "parent": "#", "text": "Root node 2" },
                           { "id": "ajson3", "parent": "ajson2", "text": "Child 1" },
                           { "id": "ajson4", "parent": "ajson2", "text": "Child 2" },


        function createJSTree(jsondata) {
                "core": {
                    "check_callback": true,
                    'data': jsondata                    
                "plugins": ["wholerow"]
    <div id="SimpleJSTree"></div>

Discussion or Comment

If you have anything in mind to share, please bring it in the discussion forum here.