1: // README
2: //
3: // There are two steps to adding a property:
4: //
5: // 1. Create a member variable to store your property
6: // 2. Add the get_ and set_ accessors for your property
7: //
8: // Remember that both are case sensitive!
9:
10:
11: /// <reference name="MicrosoftAjaxTimer.debug.js" />
12: /// <reference name="MicrosoftAjaxWebForms.debug.js" />
13: /// <reference name="AjaxControlToolkit.ExtenderBase.BaseScripts.js" assembly="AjaxControlToolkit" />
14:
15:
16: Type.registerNamespace('AJAXControls.CheckBoxSelectAll'); 17:
18: AJAXControls.CheckBoxSelectAll.CheckBoxSelectAllBehavior = function(element) { 19: AJAXControls.CheckBoxSelectAll.CheckBoxSelectAllBehavior.initializeBase(this, [element]);
20:
21: // TODO : (Step 1) Add your property variables here
22: this._CheckBoxListIDValue = null;
23: this._Selected = false;
24: this._SelectAllTextValue = "Select All";
25: this._DeselectAllTextValue = "Deselect All";
26: }
27: AJAXControls.CheckBoxSelectAll.CheckBoxSelectAllBehavior.prototype = { 28: initialize: function() { 29: AJAXControls.CheckBoxSelectAll.CheckBoxSelectAllBehavior.callBaseMethod(this, 'initialize');
30:
31: // TODO: Add your initalization code here
32: Sys.UI.DomEvent.addHandler(this.get_element(), 'click', Function.createDelegate(this, this._onclick));
33: },
34:
35: _onclick: function() { 36: var CheckBoxTable = $get(this._CheckBoxListIDValue);
37: var CheckBoxList=CheckBoxTable.getElementsByTagName("input"); 38: if (this._Selected) { 39: for (var x = 0; x < CheckBoxList.length; ++x) { 40: CheckBoxList[x].checked = false;
41: }
42: this.get_element().value = this._SelectAllTextValue;
43: this._Selected = false;
44: }
45: else { 46: for (var x = 0; x < CheckBoxList.length; ++x) { 47: CheckBoxList[x].checked = true;
48: }
49: this.get_element().value = this._DeselectAllTextValue;
50: this._Selected = true;
51: }
52: return false;
53: },
54:
55: dispose: function() { 56: // TODO: Add your cleanup code here
57:
58: AJAXControls.CheckBoxSelectAll.CheckBoxSelectAllBehavior.callBaseMethod(this, 'dispose');
59: },
60:
61: // TODO: (Step 2) Add your property accessors here
62: get_CheckBoxListID: function() { 63: return this._CheckBoxListIDValue;
64: },
65: set_CheckBoxListID: function(value) { 66: this._CheckBoxListIDValue = value;
67: },
68: get_DeselectAllText: function() { 69: return this._DeselectAllTextValue;
70: },
71: set_DeselectAllText: function(value) { 72: this._DeselectAllTextValue = value;
73: },
74: get_SelectAllText: function() { 75: return this._SelectAllTextValue;
76: },
77: set_SelectAllText: function(value) { 78: this._SelectAllTextValue = value;
79: }
80: }
81: AJAXControls.CheckBoxSelectAll.CheckBoxSelectAllBehavior.registerClass('AJAXControls.CheckBoxSelectAll.CheckBoxSelectAllBehavior', AjaxControlToolkit.BehaviorBase);