addyosmani/todomvc — comment on commit bfff7df807d0e8668c5f16aceee9612a5c7139de
File: architecture-examples/extjs/js/view/CheckAllBox.js line 7
By sindresorhus:

I've Ext'ed up this component a bit. Annoyingly it seems ExtJS uses `` for checkboxes, so I had to override that.

```javascript
// Force ExtJS to use a checkbox instead of a button
Ext.define('ss.Checkbox', {
extend: 'Ext.form.field.Checkbox',
afterRender: function() {
this.inputEl.dom.type = 'checkbox';
this.callParent(arguments);
}
});

Ext.define('Todo.view.CheckAllBox' , {
extend: 'ss.Checkbox',
alias: 'widget.checkAllBox',
boxLabel: 'Mark all as complete',
handler: function() {
console.log('checked', this.getValue() );
}
});
```

You then have access to all the Checkbox methods, like getting the value with [`.getValue()`](http://docs.sencha.com/ext-js/4-0/#!/api/Ext.form.field.Checkbox-method-getValue) or handle a check with the `.handler` method.