1. #1
    Sencha User
    Join Date
    Jun 2014
    Posts
    4
    Vote Rating
    0
    quande.ren is on a distinguished road

      0  

    Default How to disble a ButtonCell in a Grid based on some condition?

    How to disble a ButtonCell in a Grid based on some condition?


    I have a ButonCell in a Grid. I want the button to be disabled or enabled based on some conditions,. some code like following. I am wandering if it is possible to do so?

    Code:
     
    ColumnConfig column = ... 
    ButtonCell deleteButton=new ButtonCell(){     
        @Override     
        public void render(Context context, String value, SafeHtmlBuilder sb) {         
            super.render(context, value, sb);         
            int rowIndex = context.getIndex();         
            MyRecord myrecord=view.getListStore().get(rowIndex);         
            if(myrecord.getLocked()){             
                disable();         
            }     
        } 
    }; 
    deleteButton.addSelectHandler(new SelectHandler() {     
        @Override     
        public void onSelect(SelectEvent event) {         
        //should only be called when buttonCell is enabled.      
        } 
    }); 
    column.setCell(deleteButton); 
    column.setSortable(true); 
    columnList.add(column);

  2. #2
    Sencha User
    Join Date
    Jun 2014
    Posts
    4
    Vote Rating
    0
    quande.ren is on a distinguished road

      0  

    Default


    I have a ButonCell in a Grid. I want the button to be disabled or enabled based on some conditions,. some code like following. I am wandering if it is possible to do so?
    Code:
      ColumnConfig column = ...  ButtonCell deleteButton=new ButtonCell(){      	@Override      	public void render(Context context, String value, SafeHtmlBuilder sb) {          		super.render(context, value, sb);          		int rowIndex = context.getIndex();          		MyRecord myrecord=view.getListStore().get(rowIndex);          		if(myrecord.getLocked()){              			disable();          		}      	}  };  deleteButton.addSelectHandler(new SelectHandler() {      	@Override      	public void onSelect(SelectEvent event) {          	//should only be called when buttonCell is enabled.       	}  });  column.setCell(deleteButton);  column.setSortable(true);  columnList.add(column);

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..."