1. #1
    Sencha User
    Join Date
    Nov 2011
    Vote Rating
    newsam is on a distinguished road


    Default disbale button based on condition

    disbale button based on condition

    Hi all,
    I am trying to disbale button based on some condition. I tried following thing

    var simplePanel = new Ext.form.FormPanel({ 
            standardSubmit: true,  
            width: 350,
            defaults: {width: 230},
     items: [ {
                    handler :  function(b, e) {
                    disabled : function(button) {
                        //Some condition.
                       // return true or false
                    scope: this,
                    text: 'Button1',
                    width: 70,
                    xtype: 'button'
    In above case my button always remains disabled irrespective of function disabled returns true or false.
    I dont was to set the button externally(form some other location).
    I know that there is no support disabled : function mentioned in documentation. but just tried.

    Is there any way by which this can be achieved ?

  2. #2
    Sencha User
    Join Date
    Oct 2009
    Cambridge, UK
    Vote Rating
    Uberdude is on a distinguished road



    As you have noted, the disabled config option cannot be a function, it is a boolean. The setDisabled method needs to be called when you want to change the disabled status of the button. You would typically do this in an event listener for whatever event causes the disabled status to change. There is also the monitorValid property of a FormPanel, which coupled with formBind: true on the buttons means this event listener and calling of setDisabled happens 'by magic' within Ext.

Thread Participants: 1

Tags for this Thread

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..."