0

I am working in extjs4.I am going to stuck at a point where I have to handle checked and unchecked event on checkbox.I did not found proper event for this selection. I just want to handle checked and unchecked event on check box..

here Is my some code

1) view code:----

Ext.define('Am.user.Login', {
    extend:'Ext.form.Panel',
    id:'loginId',
    alias:'widget.Login',
    title:'Get your key to socialize yet earn and learn (always free)',

    items:[
    {
    ----    
    },
    { 
        xtype:'checkbox',
        fieldLabel: 'Remember me',
        name: 'remember',
        //id:'checkbox1',
        action:'check'

    },
    ],
});

2) controller code :---

Ext.define('Am.sn.UserController',
        {

            extend:'Ext.app.Controller',
                 ------------   
                     -----
            init:function()
            {
                console.log('Initialized Users! This happens before the Application launch function is called'); 
                this.control(
                {
                    'Login button[action=loginAction]':
                    {
                        click:this.authenticateUser
                    },
                    'Login checkbox[action=check]':
                    {
                        change:this.checkedRemeberMe
                    },

                }); //end of control
            },//end of init function
            checkedRemeberMe:function()
            {
                console.log("check box selected");
            },
        }); 

here i am going to use change event but it calls every time when it is selected or deselected.. Which event I is required here? please give me some suggestions...

Pravin Mane
  • 529
  • 4
  • 13
  • 25

1 Answers1

0

Why don't you just use the handler config on the checkbox? By doing so this is fired each time the box is checked or unchecked. Do your job there.

Aashray
  • 2,753
  • 16
  • 22