Error getAttribute( )

Hello, my name is Wilson Rivera,'m Latino and my English is not very good, I hope I understand

Reviewing the documents, specifically the method getAttribute (itemId, attribute).

When I test this method, the browser throws the error “is not a function tree.getAttribute”.

The documentation says it requires the library “dhtmlxtree.js”. Indeed that library is loaded in the DOM, and yet throws this error.

many Thanks

Checking the source code, I found that the “getAttribute (itemId, attr)” is not defined in “dhtmlxtree.js”.

I added in the source code as follows:

htmlXTreeObject.prototype.getAttribute = function (id, attr) { console.log ("get the attribute is requested" "+ attr +" 'node with id =' "+ id +" '"); };

After the browser generates this error.

How I can implement this feature?

The documentation says that I should just call the function and pass the parameters as indicated in the documentation website


Doing some tests, I implemented this function to respond to the request of “getAttribute”.

Not sure if it is the right way to do it.

Annex to the function code. This should be added to the end of the document “dhtmlxtree.js”

[code]dhtmlXTreeObject.prototype.getAttribute=function(id, attr){

var respuesta=null;
if(typeof attr === 'string'){
    var item = this._globalIdStorageFind(id);
        case 'text': respuesta=item.label; break;
        case 'id':; break;
        case 'checked': respuesta=item.checkstate; break;
        case 'im0': var images=item.images;                  
        case 'im1': var images=item.images;                        
        case 'im2': var images=item.images; 
        case 'open': respuesta=item.closeble;
        default: respuesta="atributo no soportado";

return respuesta;    


Everything is easier, than you think: this method needs connection of the dhtmlxtree_attrs.js extension: … tattribute