TreeNode.removeClass

Syntax

removeClass(className: String);

Parameters

className. Name of removing css-class.

Description

The removeClass method removes css-class from a node.

Example

To execute the example, the page must contain the TreeList  component named «treeList» (see Example of Creating the TreeList Component). Add two css-classes to the node with the "Africa" content and obtain new class of the node:

// Get the node with the "Africa" contents
var nodeAfrica = treeList.findText("Africa");
// Add a css-class to the node with the "Africa" contents
nodeAfrica.setClass("newClass");
// Add a css-class to the node with the "Africa" contents
nodeAfrica.addClass("anotherClass");
// Get a full name of the css-class of the node with the "Africa" contents
console.log("Full name of the css-class with the "Africa" contents: " + nodeAfrica.getDomNode().className);

As the result, the name of the node css-class with the Africa contents is displayed to the console:

Full name of the node css-class with the Africa contents is: selectable newClass anotherClass PPC

 

Remove the node css-class with the Africa contents added previously and get the full name of css-class:

// Remove css-class added previously
nodeAfrica.removeClass("anotherClass");
// Get the full name of the node css-class with the Africa contents
console.log("Full name of node css-class with the Africa contents : " + nodeAfrica.getDomNode().className);

As the result, the name of the node css-class with the Africa contents is displayed to the console:

Full name of the node css-class with the Africa contents: selectable newClass PPC

See also:

TreeNode