Hi ,
I wanna to use toolbar for grid with some addButtonTwoState buttons . It’s related to grid rows . One event I can to do - if user will select grid row/cell , then I can do that :
grid.attachEvent(“onRowSelect”, function(id,ind){
toolbar.enableItem( “toolbat_button_name” );
… });
But I can’t to find solution how to disable toolbar item if to loose grid focus , or no any row/cell is selected .
Thanks in advance !
Unfortunately there is no event handler to catch if the selection was cleared.
You may disable the toolbar item before the clearing the selection.
Also you may try to disable all two-state toolbar buttons in the onRowSelect event before the enabling the needed ones
Can you share this idea ( onRowSelect event ) with some source code . At his moment I can’t imagine how can this be done …
Thanks …
I mean something like this:
grid.attachEvent("onRowSelect", function(id,ind){
toolbar.disableItem( "toolbat_button_name0" );
toolbar.disableItem( "toolbat_button_name1" );
if (id=="id1"){
toolbar.enableItem( "toolbat_button_name" );
}
else if (id=="id2"){
toolbar.enableItem( "toolbat_button_name1" );
}
});
Thanks for the sample . It’s useful for row conditions . I think ,that this will be usefull in future …