jQuery Tree with Single Click Expand/Collapse

In order to make the jqxTree’s items to expand/collapse when the user clicks on an item, you need to set the ‘toggleMode’ property to ‘click’ Code Example:
var source = [
{
label: "Mail",
expanded: true,
items: [
{
label: "Calendar"},
{
label: "Contacts",
selected: true}
]},
{
label: "Inbox",
expanded: true,
items: [
{
label: "Admin"},
{
label: "Corporate"},
{
label: "Finance"},
{
label: "Other"},
]},
{
label: "Deleted Items"},
{
label: "Notes"},
{
label: "Settings"},
{
label: "Favorites"},
];
// create jqxTree
$('#tree').jqxTree({
source: source,
width: '250px',
toggleMode: 'click'
});‚Äč
Online Example:

About admin


This entry was posted in jQuery, jQuery Plugins, jQuery UI, jqxTree and tagged , , , , , , , . Bookmark the permalink.



Leave a Reply