Templates y Temas para ExtJS y Sencha Touch Bleext!
Bleextop! un desktop OpenSource para Ext4 y CodeIgniter http://bit.ly/pUwLJO
Poner un boton en enable ....
  • Vote Up0Vote Down udg2001udg2001 February 15
    Posts: 18
    Saludos .....

    Tengo el siguiente problema: creo un boton que nace desactivado, y este debe activarse cuando el usuario de click en una pestaña, con otros elementos de la pestaña no he tenido problemas en ponerlos en estado activo, pero este boton esta creado a nivel de la ventana, pongo el codigo para que lo entiendan mejor ....


    tabs_CotizacionAgregar = new Ext.TabPanel({
    ....
    items:[
    ....
    {
    title: 'Carta al Cliente',
    id: 'cartaCliente',
    layout: 'fit'
    }
    ]
    });

    tabs_CotizacionAgregar.getItem('cartaCliente').on('activate', function(){
    //aqui es donde se deberia activar el boton guardarCotizacion
    }

    formulario_CotizacionNuevo = new Ext.FormPanel(
    {
    title:'',
    bodyStyle:'padding: 10px',
    border:false,
    id: 'idFormularioProductoCotizar',
    autoScroll: true,
    items:[
    {
    anchor: '98%',
    layout:'fit',
    border: false,
    items: [ tabs_CotizacionAgregar ]
    },
    ]
    });


    ventana_CotizacionNuevo = new Ext.Window({
    title:'Nueva Cotización',
    ...
    items: [ formulario_CotizacionNuevo ],
    buttons: [
    {
    text: 'Guardar Cotización',
    id: 'guardarCotizacion',
    iconCls: 'icon-add',
    disabled: true,
    handler: function(){
    guardar_CotizacionNuevo();
    }
    },
    {
    text: 'Cerrar Ventana',
    iconCls: 'icon-cancel',
    handler: function(){
    cancelarAgregar_CotizacionNuevo();
    }
    }
    ]
    });


    He intentado de varias formas llegar al boton de guardar cotizacion, pero no he logrado activarlo, con otros componentes que se encuentra por ejemplo dentro de formulario_CotizacionNuevo si he logrado activarlos, pero como este boton esta definido dentro de ventana_CotizacionNuevo no se como activarlo, alguien que me pueda ayudar indicandome como lo pongo a ese boton activo ....

    Gracias ............
  • 1 Answer sorted by
  • Vote Up0Vote Down CrysfelCrysfel February 15
    Posts: 897
    Ya que le has definido un ID al botón puedes hacer lo siguiente dentro del listener:


    var btn = Ext.getCmp('guardarCotizacion');
    btn.enable();


    La verdad es que yo no recomiendo hacer uso de IDs, pero para evitar hacer uso de ID's hay que programar orientado a objetos, con clases, eventos personalizados y varias cosas más.

    Saludos

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Login with Facebook Sign In with Twitter

Sign In Apply for Membership

In this Discussion

Poll

No poll attached to this discussion.

Tagged