PDA

View Full Version : toolbar...



genius551v
16 Oct 2006, 7:39 AM
can you tell me how is the code to Disable and after Enable a buton in the tool bar ? ?

and can you tell me how add an other element for example a textbox to serch or symple text or something like that ? ?

i have this code:



toolbar = function(){

return {
init : function(){
var tb = new YAHOO.ext.Toolbar('toolbar');
tb.addButton({text: 'Add', className: 'tb-btn-add', click: adicionar});
tb.addSeparator();
tb.addButton({text: 'Mod', className: 'tb-btn-mod', click: modificar});
tb.addSeparator();
tb.addButton({text: 'Del', className: 'tb-btn-del', click: eliminar});
tb.addSeparator();
tb.addButton({text: 'Clear', className: 'tb-btn-clear', click: limpiar});
tb.addSeparator();
tb.addButton({text: 'Serch', className: 'tb-btn-consult', click: consultar});
}
};
}();


really tnks...

jack.slocum
16 Oct 2006, 8:04 AM
tb.addButton() returns a ToolbarButton object. That object has enable(), disable() and other functions.

You can add anything to the toolbar via the add() method.



var textfield = document.getElementById('miField');
toolbar.add(textfield);

genius551v
16 Oct 2006, 10:16 AM
Great...tnks!