Hi all,

I have these two methods that I want to override, but not for the entire class only for a particular instance of the class.

Currently the methods are overriding all the check boxes in my app and I just want to override just the one in this grid. Is this possible and if so what would be the right syntax?

This is the grid where the check box exists:


			<ext:GridPanel ItemID="dgvApproval" runat="server" StripeRows="true" MarginSpec="0 5 5 5" ID="dgvApproval"> 
					<View>
						<ext:GridView EmptyText="No approval levels" />
					</View>
					<Store>
						<ext:Store>
							<Model>
								<ext:Model runat="server" IDProperty="PK_">
									<Fields>
										<ext:ModelField Name="PK" Type="Int" AllowNull="True" />
										<ext:ModelField Name="Level" Type="Int" />
										<ext:ModelField Name="Approval Status" />

									</Fields>
								</ext:Model>
							</Model>
						</ext:Store>
					</Store>
					<ColumnModel runat="server">
						<Columns>
							<alc:IntegerColumn Header="Level" DataIndex="Level" Width="60" />
							<ext:Column Header="Approval Status" DataIndex="Status" Width="80" />

						</Columns>
					</ColumnModel>
					<SelectionModel  >
						<ext:CheckboxSelectionModel runat="server" Mode="Multi" ShowHeaderCheckbox="True" >
							<Listeners>
								<BeforeSelect Fn="function(grid, record, index, eOpts) {
							           if (record.get('Status') == 'Not Applicable') {
							                return false;
							            }
							        }"></BeforeSelect>
							</Listeners>
						</ext:CheckboxSelectionModel>
					</SelectionModel>
				</ext:GridPanel>

These are the two methods I want to override:


Ext.selection.CheckboxModel.override({
			onHeaderClick: function (headerCt, header, e) {

				var me = this,
					store = me.store,
					isChecked, records, i, len, selections, selection;
				if (header.isCheckerHd) {
					e.stopEvent();
					isChecked = header.el.hasCls(Ext.baseCSSPrefix + 'grid-hd-checker-on');

					if (isChecked) {
						records = [];
						selections = this.getSelection();
						for (i = 0, len = selections.length; i < len; ++i) {
							selection = selections[i];
							if (store.indexOf(selection) > -1) {
								records.push(selection);
							}
						}
						if (records.length > 0) {
							me.deselect(records);
						}
					} else {
						me.selectAll();
					}
				}
			},
			updateHeaderState: function () {
				var me = this,
					store = me.store,
					storeCount = store.getCount(),
					views = me.views,
					countApprovals= 0,
					hdSelectStatus = false,
					selectedCount = 0,
					selected, records, len, i;
				if (!store.isBufferedStore && storeCount > 0) {
					selected = me.selected;
					hdSelectStatus = true;

					for (i = 0, len = selected.getCount(); i < len; ++i) {
						if (store.indexOfId(selected.getAt(i).id) > -1) {
							++selectedCount;
						}
					}
					if (selected.getCount !== 0) {
						for (i = 0, len = storeCount; i < len; ++i) {
							if (store.data.getAt(i).data.Status != 'Not Applicable') {
								++countApprovals;
							}
						}
					}
					hdSelectStatus = countApprovals === selectedCount;
				}
				if (views && views.length) {
					me.column.setHeaderStatus(hdSelectStatus);
				}
			},

		});