Quantcast
Channel: Angular, Vue, React, Web Components, Javascript, HTML5 Widgets
Viewing all articles
Browse latest Browse all 306

jQuery Tree with Single Click Expand/Collapse

$
0
0
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:

Viewing all articles
Browse latest Browse all 306

Trending Articles