📄 filteredtextboxbehavior.js
字号:
set_ValidChars : function(value) {
if (this._validChars != null || this.charTypes.Custom != value) {
this.charTypes.Custom = value;
this._validChars = null;
this.raisePropertyChanged('ValidChars');
}
},
get_InvalidChars : function() {
/// <value type="String">
/// A string consisting of all characters considered invalid for the textbox, if "Custom" is specified as the field type. Otherwise this parameter is ignored.
/// </value>
return this.charTypes.Custom;
},
set_InvalidChars : function(value) {
if (this._invalidChars != null || this.charTypes.Custom != value) {
this.charTypes.Custom = value;
this._invalidChars = null;
this.raisePropertyChanged('InvalidChars');
}
},
get_FilterType : function() {
/// <value type="AjaxControlToolkit.FilterTypes">
/// FilterType - A the type of filter to apply, as a comma-separated combination of
/// Numbers, LowercaseLetters, UppercaseLetters, and Custom. If Custom is specified,
/// the ValidChars field will be used in addition to other settings such as Numbers.
/// </value>
return this._filterType;
},
set_FilterType : function(value) {
if (this._validChars != null || this._filterType != value) {
this._filterType = value;
this._validChars = null;
this.raisePropertyChanged('FilterType');
}
},
get_FilterMode : function() {
/// <value type="AjaxControlToolkit.FilterModes">
/// FilterMode - The filter mode to apply when custom filtering is activated; supported values are ValidChars and InvalidChars.
/// </value>
return this._filterMode;
},
set_FilterMode : function(value) {
if (this._validChars != null || this._invalidChars != null || this._filterMode != value) {
this._filterMode = value;
this._validChars = null;
this._invalidChars = null;
this.raisePropertyChanged('FilterMode');
}
},
get_FilterInterval : function() {
/// <value type="int">
/// An integer containing the interval (in milliseconds) in which
/// the field's contents are filtered
/// </value>
return this._filterInterval;
},
set_FilterInterval : function(value) {
if (this._filterInterval != value) {
this._filterInterval = value;
this.raisePropertyChanged('FilterInterval');
}
},
add_processKey : function(handler) {
/// <summary>
/// Add an event handler for the processKey event
/// </summary>
/// <param name="handler" type="Function" mayBeNull="false">
/// Event handler
/// </param>
/// <returns />
this.get_events().addHandler('processKey', handler);
},
remove_processKey : function(handler) {
/// <summary>
/// Remove an event handler from the processKey event
/// </summary>
/// <param name="handler" type="Function" mayBeNull="false">
/// Event handler
/// </param>
/// <returns />
this.get_events().removeHandler('processKey', handler);
},
raiseProcessKey : function(eventArgs) {
/// <summary>
/// Raise the processKey event
/// </summary>
/// <param name="eventArgs" type="AjaxControlToolkit.FilteredTextBoxProcessKeyEventArgs" mayBeNull="false">
/// Event arguments for the processKey event
/// </param>
/// <returns />
var handler = this.get_events().getHandler('processKey');
if (handler) {
handler(this, eventArgs);
}
},
add_filtered : function(handler) {
/// <summary>
/// Add an event handler for the filtered event
/// </summary>
/// <param name="handler" type="Function" mayBeNull="false">
/// Event handler
/// </param>
/// <returns />
this.get_events().addHandler('filtered', handler);
},
remove_filtered : function(handler) {
/// <summary>
/// Remove an event handler from the filtered event
/// </summary>
/// <param name="handler" type="Function" mayBeNull="false">
/// Event handler
/// </param>
/// <returns />
this.get_events().removeHandler('filtered', handler);
},
raiseFiltered : function(eventArgs) {
/// <summary>
/// Raise the filtered event
/// </summary>
/// <param name="eventArgs" type="AjaxControlToolkit.FilteredTextBoxEventArgs" mayBeNull="false">
/// Event arguments for the filtered event
/// </param>
/// <returns />
var handler = this.get_events().getHandler('filtered');
if (handler) {
handler(this, eventArgs);
}
}
}
AjaxControlToolkit.FilteredTextBoxBehavior.registerClass('AjaxControlToolkit.FilteredTextBoxBehavior', AjaxControlToolkit.BehaviorBase);
AjaxControlToolkit.FilterTypes = function() {
/// <summary>
/// Character filter to be applied to a textbox
/// </summary>
/// <field name="Custom" type="Number" integer="true">
/// Custom Characters
/// </field>
/// <field name="Numbers" type="Number" integer="true">
/// Numbers (0123456789)
/// </field>
/// <field name="UppercaseLetters" type="Number" integer="true">
/// Uppercase Letters (ABCDEFGHIJKLMNOPQRSTUVWXYZ)
/// </field>
/// <field name="LowercaseLetters" type="Number" integer="true">
/// Lowercase Letters (abcdefghijklmnopqrstuvwxyz)
/// </field>
throw Error.invalidOperation();
}
AjaxControlToolkit.FilterTypes.prototype = {
Custom : 0x1,
Numbers : 0x2,
UppercaseLetters : 0x4,
LowercaseLetters : 0x8
}
AjaxControlToolkit.FilterTypes.registerEnum('AjaxControlToolkit.FilterTypes', true);
AjaxControlToolkit.FilterModes = function() {
/// <summary>
/// Filter mode to be applied to a textbox
/// </summary>
/// <field name="ValidChars" type="Number" integer="true">
/// Provide a list of valid characters
/// </field>
/// <field name="InvalidChars" type="Number" integer="true">
/// Provide a list of invalid characters
/// </field>
throw Error.invalidOperation();
}
AjaxControlToolkit.FilterModes.prototype = {
ValidChars : 0x1,
InvalidChars : 0x2
}
AjaxControlToolkit.FilterModes.registerEnum('AjaxControlToolkit.FilterModes', true);
AjaxControlToolkit.FilteredTextBoxProcessKeyEventArgs = function(key, text, shouldFilter) {
/// <summary>
/// Event arguments used when the processKey event is raised
/// </summary>
/// <param name="key" type="String" mayBeNull="False">
/// Key to be processed
/// </param>
/// <param name="text" type="String" mayBeNull="True">
/// Current text in the textbox
/// </param>
/// <param name="shouldFilter" type="Boolean" mayBeNull="False">
/// Whether the character should be filtered given the current
/// FilteredTextBox settings
/// </param>
AjaxControlToolkit.FilteredTextBoxProcessKeyEventArgs.initializeBase(this);
this._key = key;
this._text = text;
this._shouldFilter = shouldFilter;
this._allowKey = !shouldFilter;
}
AjaxControlToolkit.FilteredTextBoxProcessKeyEventArgs.prototype = {
get_key : function() {
/// <value type="String" mayBeNull="False">
/// Key to be processed
/// </value>
return this._key;
},
get_text : function() {
/// <value type="String" mayBeNull="True">
/// Current text in the textbox
/// </value>
return this._text;
},
get_shouldFilter : function() {
/// <value type="Boolean" mayBeNull="False">
/// Whether the character should be filtered given the current
/// FilteredTextBox settings
/// </value>
return this._shouldFilter;
},
get_allowKey : function() {
/// <value type="Boolean" mayBeNull="False">
/// Whether or not the key will be filtered. It defaults to the opposite of
/// shouldFilter and should be set by handlers of the processKey event.
/// </value>
return this._allowKey;
},
set_allowKey : function(value) {
this._allowKey = value;
}
}
AjaxControlToolkit.FilteredTextBoxProcessKeyEventArgs.registerClass('AjaxControlToolkit.FilteredTextBoxProcessKeyEventArgs', Sys.EventArgs);
AjaxControlToolkit.FilteredTextBoxEventArgs = function(key) {
/// <summary>
/// Event arguments used when the filtered event is raised
/// </summary>
/// <param name="key" type="String" mayBeNull="False">
/// Key that was filtered
/// </param>
AjaxControlToolkit.FilteredTextBoxEventArgs.initializeBase(this);
this._key = key;
}
AjaxControlToolkit.FilteredTextBoxEventArgs.prototype = {
get_key : function() {
/// <value type="String" mayBeNull="False">
/// Key that was filtered
/// </value>
return this._key;
}
}
AjaxControlToolkit.FilteredTextBoxEventArgs.registerClass('AjaxControlToolkit.FilteredTextBoxEventArgs', Sys.EventArgs);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -