toolbar getItemState error when item disabled

i got the following error code, when checking item state when item disabled (toolbar.getItemState):

this.objPull[itemId] is undefined

i have the solution, to firstly check if element enabled (isEnabled), but would be better having only one condition

now the code look like this:

if (ten_tool2.isEnabled("tova") == true) { if (ten_tool2.getItemState("tova") == true) { var tovabbk = true; } } if (tovabbk == false) {...xyz...

this one gives error:

if (ten_tool2.getItemState("tova") == true) {...xyz...

Hi,

do you use the latest toolbar version (2.6) ? Locally the problem has not been reproduced with it.

no, it is 2.5…

So, please try using 2.6

I have the same error for a simple use of :

toolbar.hideItem(‘name’); or toolbar.disableItem(‘name’);

i’v just downloaded last version of js file

thanks

Have you called these methods for the existent item ? Please provide the demo to reproduce the problem

I have the same problem when trying to disable/enable items in a toolbar from a select event in a tree:

dhxTree.attachEvent("onSelect", function(itemId) {
    dhtmlx.message("Item " + itemId + " selected.");
				
    dhxToolBar.disableItem('new_sector');
    dhxToolBar.disableItem('new_zone');
    switch(dhxTree.getUserData(itemId, 'itemType')){
        case 'building':
            dhxToolBar.enableItem('new_sector');
            break;
        case 'sector':
            dhxToolBar.enableItem('new_zone');
            break;
        default:
            break;
    }
    return true;
});

Any update on that? I use dhtmlxSuite_v30_pro_111031_eval.

Additional info:

it works with items but not with sub-items.