Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Fyodor on Jan 01, 2010 07:32
open dhtmlx forum
Click a button in toolbar dynamiccaly

Hi friends,
I want to ask a question about dhtmlxtoolbars button. Is it possible to click a button on dhtmlxtoolbar with another javascript code?

Etc:

function clickToolBarItem(id) {
//code will be here when it run it will autmatically click the button "id"
}

Thanks
Answer posted by Alex (support) on Jan 04, 2010 05:04

Hello,

please explain the idea in detail. 

If you want to change the state of 2-state button you can use the setItemState method:

toolbar.setItemState(itemId, true);

If you have set the onClick event handler and need to call it manually, it can be done easily - for example:

toolbar.attachEvent("onClick",doOnClick);

function doOnClick(id){

/*some code here*/

}

doOnClick(someId);