Introduction To jsTree Plugins
Posted By : Sagar Watts | 18-Sep-2017
As we know jsTree provide us the number of features, however all these features are not included in the core. To make use of these features, we have number of plugins, which can be activated as per our requirement. To activate the plugin, we need to pass the name of the plugin in the “plugins” configuration option. We can activate as many plugins as we want. And also each plugin can be configured passing the object having the same name as of plugin.
Activate Plugins: The required plugins can be activated while creating the tree instance. We can pass an array of the plugin names in the property “plugins” of the configuration object. The activation process is quite simple, however these plugins also provides us configuration options of their owns. Here is how we can activate the plugins:
"plugins" : ["checkbox"]
Configuration: Now that we have activated plugin, we need to configure them in order to use them. So along with the plugins, we also need to provide the configuration for each of the activated plugin. The configuration object is of the same name as of the plugin having different properties for each of plugin.Here is how we can configure the plugin :
"checkbox" : {
"keep_selected_style" : false
},
jsTree plugins: Here is the brief about some of the plugins jsTree provided us.
-
checkbox: If we want to place a checkbox in front of node, we can make use of the checkbox plugin. This plugin make the tree attractive and easier the process of getting input from user from the tree.
-
search : Many times it happens that the data to represent in the tree is quite long and we have to scroll and search for the specific node. The search plugin make our task easier. We can activate this plugin to enable the search between the nodes.
-
contextMenu: This plugin is useful if we want to enable the right click on the node and shows a list of options in menu.
-
dnd: This is quite useful plugin to add the drag n drop functionality in your tree. We can rearrange the tree nodes by dragging them and drop them at the required location.
Apart from that , we have number of plugins for different functionality, which makes our tree more and more useful and easier to use as per the user perspective.
Cookies are important to the proper functioning of a site. To improve your experience, we use cookies to remember log-in details and provide secure log-in, collect statistics to optimize site functionality, and deliver content tailored to your interests. Click Agree and Proceed to accept cookies and go directly to the site or click on View Cookie Settings to see detailed descriptions of the types of cookies and choose whether to accept certain cookies while on the site.
About Author
Sagar Watts
Sagar is a bright Web App Lead Developer , he has great knowledge of core Java and advance Java. His hobbies are Net Surfing, Listen Music and Reading Books.