1. #1
    Sencha User
    Join Date
    Jul 2009
    Posts
    16
    Vote Rating
    0
    sajjan.sarkar is on a distinguished road

      0  

    Question Firing Onclick Event Doesnt call Eventhandler

    Firing Onclick Event Doesnt call Eventhandler


    Hi,

    I have a table in which one column has only checkboxes. I use a gridcellrenderer to render the checkbox and assign click event handlers.As I render every checkbox I also add it to a global List<CheckBox>.

    Now outside the grid I have a radiobutton which should, when clicked, go through all the checkboxes in this list and fire a click event on each one.My problem is, that the event handlers dont seem to get called at all when I fire the event programmatically. (They do fire if I click the checkboxes)

    Can someone point me where I'm going wrong?
    Code:

    Code:
    { 
    // The global list:
    private final List<CheckBox> listOfCheckBoxes = new ArrayList<CheckBox>();
    :
    :
    // code to render checkbox, assign handlers and add to list
    //
    myColumn.setRenderer(new GridCellRenderer<ModelData>() {
                @SuppressWarnings("deprecation")
                @Override
                public Object render(ModelData model, String property,
                        ColumnData config, final int rowIndex, final int colIndex,
                        final ListStore<ModelData> store, final Grid<ModelData> grid) {
    :
    :
    final CheckBox  cb= new CheckBox();
    cb.addListener(Events.OnClick, new Listener<BaseEvent>() {
                             @Override
                            public void handleEvent(BaseEvent be) {
                                // do something
                        });
    :
    :
    // this grid is added to a contentpanel, this content panel also has a radio button
    selectAllRadio = new Radio();    
            selectAllRadio.addListener(Events.OnClick, new Listener<BaseEvent>() {
    
    
                @Override
                public void handleEvent(BaseEvent be) {
                    for (StatusCheckBox scb : listOfBoxes) {
                scb.fireEvent(Events.OnClick);
                    
        
            }
                    
                }
            });
    
    
    
    }
    Last edited by sajjan.sarkar; 1 Sep 2011 at 11:45 AM. Reason: [IGNORE] Silly mistake on my part.

  2. #2
    Sencha User
    Join Date
    Jul 2009
    Posts
    16
    Vote Rating
    0
    sajjan.sarkar is on a distinguished road

      0  

    Default


    [IGNORE] Silly mistake on my part nothing to do with the problem. Please delete this thread, I apologize.

Tags for this Thread

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar