Update tools with javascript

Hello,
I tried to update items in the toolbar of a gridplot named gpp by removing some CustomAcrtion tools, but it does not work (icons remain there as well as functionalities).

I really haven’t found a more specific way to implement than what is described below
(removing some custom tools (CustomAction) in the js template), but obviously somehow not referencing correctly to the defined actions in the toolbar :

Thanks a lot for any hint !

var tool_array = gpp.children[0].toolbar.tools;
var tool_array_filtered = tool_array.filter(function(value, index, arr){
   return value.tool_name != "Custom Action";
});
gpp.children[0].toolbar.tools = tool_array_filtered;

I also tried to remove it at the figure level:

var plot_tool_array = gpp.children[1].children[0][0].toolbar.tools;
var plot_tool_array_filtered = plot_tool_array.filter(function(value, index, arr){
    return value.tool_name != "Custom Action";
});
gpp.children[1].children[0][0].toolbar.tools = plot_tool_array_filtered;

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.