First I have Ext.ux.ListView.plugin.CheckColumn. This works similar to the example ux Grid CheckColumn plugin except it's for a ListView. It changes the store value and fires beforecheck and check events. It can be configured to keep row selections and use other click events like dblclick rather than the default click event. Code was inspired by Saki's RowAction code and the Ext example ux.
Extract into the examples/list folder for a demo. (Must be behind a webserver to load the plants.xml file)
Ext.ux.ListView.plugin.CheckColumn.zip
Changelog
2 Sep 2010: v0.2 added more docs
Use Ext.ux.ListView.plugin.CheckColumn if you need to be able to be able to check and uncheck the checkbox.
If all you want to do is display a checkbox instead of a True/False string for a boolean column then use Ext.ux.list.CheckColumn. It behaves exactly like Ext.list.BooleanColumn
PHP Code:
/**
* @class Ext.ux.list.CheckColumn
* @extends Ext.list.Column
*/
Ext.ns('Ext.ux.list');
Ext.ux.list.CheckColumn = Ext.extend(Ext.list.Column, {
constructor : function(c) {
c.tpl = c.tpl || new Ext.XTemplate('{' + c.dataIndex + ':this.format}');
c.tpl.format = function(v) {
return String.format('<div class="x-grid3-check-col{0}"> </div>', v ? '-on' : '');
};
Ext.ux.list.CheckColumn.superclass.constructor.call(this, c);
}
});
Ext.reg('lvcheckcolumn', Ext.ux.list.CheckColumn);