X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/6746dc89c47ed01b165cc1152533605f97eb8e8d..refs/heads/master:/docs/source/CheckboxModel.html
diff --git a/docs/source/CheckboxModel.html b/docs/source/CheckboxModel.html
index 139ab5ea..910dd3ae 100644
--- a/docs/source/CheckboxModel.html
+++ b/docs/source/CheckboxModel.html
@@ -3,8 +3,8 @@
The source code
-
-
+
+
@@ -37,40 +37,72 @@ Ext.define('Ext.selection.CheckboxModel', {
mode: 'MULTI',
/**
- * @cfg {Mixed} injectCheckbox
+ * @cfg {Number/Boolean/String} injectCheckbox
* Instructs the SelectionModel whether or not to inject the checkbox header
* automatically or not. (Note: By not placing the checkbox in manually, the
* grid view will need to be rendered 2x on initial render.)
* Supported values are a Number index, false and the strings 'first' and 'last'.
- * Default is 0.
*/
injectCheckbox: 0,
/**
* @cfg {Boolean} checkOnly <tt>true</tt> if rows can only be selected by clicking on the
- * checkbox column (defaults to <tt>false</tt>).
+ * checkbox column.
*/
checkOnly: false,
+ headerWidth: 24,
+
// private
checkerOnCls: Ext.baseCSSPrefix + 'grid-hd-checker-on',
- bindComponent: function() {
- this.sortable = false;
- this.callParent(arguments);
+ bindComponent: function(view) {
+ var me = this;
- var view = this.views[0],
+ me.sortable = false;
+ me.callParent(arguments);
+ if (!me.hasLockedHeader() || view.headerCt.lockedCt) {
+ // if we have a locked header, only hook up to the first
+ view.headerCt.on('headerclick', me.onHeaderClick, me);
+ me.addCheckbox(true);
+ me.mon(view.ownerCt, 'reconfigure', me.addCheckbox, me);
+ }
+ },
+
+ hasLockedHeader: function(){
+ var hasLocked = false;
+ Ext.each(this.views, function(view){
+ if (view.headerCt.lockedCt) {
+ hasLocked = true;
+ return false;
+ }
+ });
+ return hasLocked;
+ },
+
+ /**
+ * Add the header checkbox to the header row
+ * @private
+ * @param {Boolean} initial True if we're binding for the first time.
+ */
+ addCheckbox: function(initial){
+ var me = this,
+ checkbox = me.injectCheckbox,
+ view = me.views[0],
headerCt = view.headerCt;
- if (this.injectCheckbox !== false) {
- if (this.injectCheckbox == 'first') {
- this.injectCheckbox = 0;
- } else if (this.injectCheckbox == 'last') {
- this.injectCheckbox = headerCt.getColumnCount();
+ if (checkbox !== false) {
+ if (checkbox == 'first') {
+ checkbox = 0;
+ } else if (checkbox == 'last') {
+ checkbox = headerCt.getColumnCount();
}
- headerCt.add(this.injectCheckbox, this.getHeaderConfig());
+ headerCt.add(checkbox, me.getHeaderConfig());
+ }
+
+ if (initial !== true) {
+ view.refresh();
}
- headerCt.on('headerclick', this.onHeaderClick, this);
},