var _____WB$wombat$assign$function_____ = function(name) {return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name)) || self[name]; }; if (!self.__WB_pmw) { self.__WB_pmw = function(obj) { this.__WB_source = obj; return this; } } { let window = _____WB$wombat$assign$function_____("window"); let self = _____WB$wombat$assign$function_____("self"); let document = _____WB$wombat$assign$function_____("document"); let location = _____WB$wombat$assign$function_____("location"); let top = _____WB$wombat$assign$function_____("top"); let parent = _____WB$wombat$assign$function_____("parent"); let frames = _____WB$wombat$assign$function_____("frames"); let opener = _____WB$wombat$assign$function_____("opener"); var __aspxLoadFilteredItemsCallbackPrefix = "CBLF"; var __aspxCorrectFilterCallbackPrefix = "CBCF"; var __aspxtCurrentSelectedItemCallbackPrefix = "CBSI"; var __aspxDropDownNameSuffix = "_DDD"; var __aspxCalendarNameSuffix = "_C"; var __aspxListBoxNameSuffix = "_L"; var __aspxItemImageCellClassName = "dxeIIC"; ASPxClientDropDownEditBase = _aspxCreateClass(ASPxClientButtonEditBase, { constructor: function(name) { this.constructor.prototype.constructor.call(this, name); this.DropDown = new ASPxClientEvent(); this.CloseUp = new ASPxClientEvent(); this.ddHeightCache = __aspxInvalidDimension; this.ddWidthCache = __aspxInvalidDimension; this.mainElementWidthCache = __aspxInvalidDimension; this.dropDownButtonIndex = -1; this.droppedDown = false; this.ddButtonPushed = false; this.lastSuccessText = ""; this.isToolbarItem = false; this.allowFocusDropDownWindow = false; this.pcIsShowingNow = false; aspxGetDropDownCollection().Add(this); }, Initialize: function(){ var pc = this.GetPopupControl(); if(pc) { pc.allowCorrectYOffsetPosition = false; pc.dropDownEditName = this.name; } this.AssignClientAttributes(); this.InitLastSuccessText(); if(this.RefocusOnClickRequired()){ var clickFunc = new Function("aspxDDRefocusClick('" + this.name + "', event);"); _aspxAttachEventToElement(this.GetMainElement(), "click", clickFunc); } ASPxClientButtonEditBase.prototype.Initialize.call(this); }, InitLastSuccessText: function(){ var rawText = this.GetTextInternal(); this.SetLastSuccessTest(rawText); }, AssignClientAttributes: function(){ var element = this.GetDropDownButton(); if(_aspxIsExistsElement(element)) _aspxPreventElementDragAndSelect(element, true); }, RefocusOnClickRequired: function(){ return false; }, GetDropDownButton: function(){ return this.GetButton(this.dropDownButtonIndex); }, GetPopupControl: function(){ return aspxGetControlCollection().Get(this.name + __aspxDropDownNameSuffix); }, GetDropDownInnerControlName: function(suffix){ var pc = this.GetPopupControl(); if(pc) return this.GetPopupControl().name + suffix; return ""; }, GetDropDownItemImageCell: function() { return _aspxGetChildrenByPartialClassName(this.GetMainElement(), __aspxItemImageCellClassName)[0]; }, GetIsControlWidthWasChanged: function(){ return this.mainElementWidthCache == __aspxInvalidDimension || this.mainElementWidthCache != this.GetMainElement().clientWidth; }, GetDropDownHeight: function(){ return 0; }, GetDropDownWidth: function(){ return 0; }, GetDropDownIsWindowElement: function(id, pcPostfix) { var pos = id.lastIndexOf(pcPostfix); if(pos != -1) { var name = id.substring(0, pos); var pc = aspxGetPopupControlCollection().Get(name); if(pc && pc.dropDownEditName) return aspxGetDropDownCollection().Get(pc.dropDownEditName); } return null; }, GetDropDownParents: function() { var parents = [ ]; var mainElement = this.GetMainElement(); var pcPostfix = __aspxPCWIdSuffix + "-1"; var element = mainElement.parentNode; while(element != null){ if(element.tagName == "BODY") break; if(element.id) { var dropDown = this.GetDropDownIsWindowElement(element.id, pcPostfix); if(dropDown != null) parents.push(dropDown); } element = element.parentNode; } return parents.reverse(); }, BeforePopupControlResizing: function() { }, AfterPopupControlResizing: function() { }, ShowDropDownArea: function(isRaiseEvent){ this.SetPCIsShowingNow(true); aspxGetDropDownCollection().RegisterDroppedDownControl(this, this.GetDropDownParents()); if(!this.droppedDown) this.lockListBoxClick = true; this.lockClosing = true; var pc = this.GetPopupControl(); var element = this.GetMainElement(); var pcwElement = pc.GetWindowElement(-1); _aspxSetElementDisplay(pcwElement, true); var height = this.GetDropDownHeight(); var width = this.GetDropDownWidth(); this.BeforePopupControlResizing(); if(this.ddHeightCache != height || this.ddWidthCache != width){ pc.SetSize(width, height); this.ddHeightCache = height; this.ddWidthCache = width; } this.AfterPopupControlResizing(); pc.popupVerticalOffset = - _aspxGetClientTop(element); this.RaiseDropDownEventRequired = isRaiseEvent; pc.ShowAtElement(element); this.droppedDown = true; this.lockClosing = false; }, HideDropDownArea: function(isRaiseEvent){ if(this.lockClosing || !this.droppedDown) return; this.DropDownButtonPop(); var pc = this.GetPopupControl(); if (pc){ aspxGetDropDownCollection().UnregisterDroppedDownControl(this); pc.Hide(); if(isRaiseEvent) this.RaiseCloseUp(); this.droppedDown = false; } }, ProcessInternalButtonClick: function(buttonIndex) { return this.dropDownButtonIndex == buttonIndex; }, ToggleDropDown: function(){ this.OnApplyChanges(); if(this.droppedDown) this.HideDropDownArea(true); else this.ShowDropDownArea(true); }, GetTextInternal: function(){ var text = ASPxClientButtonEditBase.prototype.GetValue.call(this); return text != null ? text : ""; }, SetTextInternal: function(text){ if(!this.readOnly) this.SetTextBase(text); }, SetTextBase: function(text) { ASPxClientButtonEditBase.prototype.SetValue.call(this, text); }, SetLastSuccessTest: function(text){ if(text == null) text = ""; this.lastSuccessText = text; }, RollbackTextInputValue: function () { this.SetTextBase(this.lastSuccessText); }, SetPCIsShowingNow: function(value){ this.pcIsShowingNow = value; }, OnValueChanged: function() { this.SetLastSuccessTest(this.GetTextInternal()); ASPxClientEdit.prototype.OnValueChanged.call(this); }, OnApplyChanges: function(){ }, OnCancelChanges: function(){ var isCancelProcessed = (this.GetTextInternal() != this.lastSuccessText); this.SetTextInternal(this.lastSuccessText); return isCancelProcessed; }, OnFocus: function(){ this.OnSetFocus(true); ASPxClientButtonEditBase.prototype.OnFocus.call(this); }, OnLostFocus: function(){ this.OnSetFocus(false); ASPxClientButtonEditBase.prototype.OnLostFocus.call(this); }, OnSetFocus: function(isFocused){ aspxGetDropDownCollection().SetFocusedDropDownName(isFocused ? this.name : ""); }, IsEditorElement: function(element) { if(ASPxClientButtonEditBase.prototype.IsEditorElement.call(this, element)) return true; if(this.allowFocusDropDownWindow) return false; var pc = this.GetPopupControl(); if(pc != null) { var windowElement = pc.GetWindowElement(-1); return windowElement == element || _aspxGetIsParent(windowElement, element); } return false; }, OnPopupControlShown: function(){ this.SetPCIsShowingNow(false); if(this.RaiseDropDownEventRequired){ this.RaiseDropDownEventRequired = false; _aspxSetTimeout("aspxDDBRaiseDropDownByTimer(\"" + this.name + "\")", 0); } }, IsCanToDropDown: function(){ return true; }, OnDropDown: function(evt) { if(!this.isInitialized) return true; if(!this.IsCanToDropDown()) { this.ForceRefocusEditor(); return true; } if(__aspxIE || __aspxOpera){ if(!this.droppedDown) { _aspxEmulateOnMouseDown(this.GetMainElement(), evt); aspxGetStateController().ClearSavedCurrentPressedElement(); } } this.OnDropDownCore(evt); return _aspxCancelBubble(evt); }, OnDropDownCore: function(evt) { if(!this.droppedDown) this.DropDownButtonPush(); this.ToggleDropDown(); this.ForceRefocusEditor(); }, DropDownButtonPush: function(){ if(this.droppedDown || this.ddButtonPushed) return; this.ddButtonPushed = true; if(__aspxIE || __aspxOpera) this.DropDownButtonPushPop(true); else this.DropDownButtonPushMozilla(); }, DropDownButtonPop: function(force){ if((!this.droppedDown || !this.ddButtonPushed) && !force) return; this.ddButtonPushed = false; if(__aspxIE || __aspxOpera) this.DropDownButtonPushPop(false); else this.DropDownButtonPopMozilla(); }, DropDownButtonPushPop: function(isPush){ var buttonElement = this.GetDropDownButton(); if(buttonElement){ var controller = aspxGetStateController(); var element = controller.GetPressedElement(buttonElement); if(element){ if(isPush){ controller.SetCurrentHoverElement(null); controller.DoSetPressedState(element); } else { controller.DoClearPressedState(element); controller.SetCurrentPressedElement(null); controller.SetCurrentHoverElement(element); } } } }, DropDownButtonPushMozilla: function(){ this.DisableStyleControllerForDDButton(); var controller = aspxGetStateController(); controller.savedCurrentPressedElement = null; }, DropDownButtonPopMozilla: function(){ this.EnableStyleControllerForDDButton(); var controller = aspxGetStateController(); var buttonElement = this.GetDropDownButton(); if(buttonElement){ var element = controller.GetPressedElement(buttonElement); if(element) controller.DoClearPressedState(element); controller.currentPressedElement = null; element = controller.GetHoverElement(buttonElement); if(element) controller.SetCurrentHoverElement(element); } }, EnableStyleControllerForDDButton: function(){ var element = this.GetDropDownButton(); if(element){ var controller = aspxGetStateController(); this.ReplaceElementControlStyleItem(controller.hoverItems, __aspxHoverItemKind, element, this.ddButtonHoverStyle); this.ReplaceElementControlStyleItem(controller.pressedItems, __aspxPressedItemKind, element, this.ddButtonPressedStyle); this.ReplaceElementControlStyleItem(controller.selectedItems, __aspxSelectedItemKind, element, this.ddButtonSelectedStyle); } }, DisableStyleControllerForDDButton: function(){ var element = this.GetDropDownButton(); if(element){ var controller = aspxGetStateController(); this.ddButtonHoverStyle = this.ReplaceElementControlStyleItem(controller.hoverItems, __aspxHoverItemKind, element, null); this.ddButtonPressedStyle = this.ReplaceElementControlStyleItem(controller.pressedItems, __aspxPressedItemKind, element, null); this.ddButtonSelectedStyle = this.ReplaceElementControlStyleItem(controller.selectedItems, __aspxSelectedItemKind, element, null); } }, ReplaceElementControlStyleItem: function(items, kind, element, newStyleItem){ var styleItem = items[element.id]; items[element.id] = newStyleItem; element[kind] = newStyleItem; return styleItem; }, CloseDropDownByDocumentOrWindowEvent: function(causedByWindowResizing){ if(!causedByWindowResizing || !this.pcIsShowingNow) this.HideDropDownArea(true); }, OnDocumentMouseUp: function() { this.DropDownButtonPop(); }, OnDDButtonMouseMove: function(evt){ }, OnCloseUp: function(evt){ this.HideDropDownArea(true); }, OnOpenAnotherDropDown: function(){ this.HideDropDownArea(true); }, OnTextChanged: function() { if(!this.ChangedByEnterKeyPress()) this.OnTextChangedInternal(); }, OnTextChangedInternal: function() { this.ParseValue(); }, ChangedByEnterKeyPress: function() { if(__aspxFirefox || __aspxWebKitFamily) if(this.enterKeyPressed) { this.enterKeyPressed = false; return true; } return false; }, ChangeEnabledAttributes: function(enabled){ ASPxClientButtonEditBase.prototype.ChangeEnabledAttributes.call(this, enabled); var btnElement = this.GetDropDownButton(); if(btnElement) this.ChangeButtonEnabledAttributes(btnElement, _aspxChangeAttributesMethod(enabled)); var inputElement = this.GetInputElement(); if(inputElement) this.ChangeInputCellEnabledAttributes(inputElement.parentNode, _aspxChangeAttributesMethod(enabled)); var imageCell = this.GetDropDownItemImageCell(); if(_aspxIsExists(imageCell)) this.ChangeImageCellEnabledAttributes(imageCell, _aspxChangeAttributesMethod(enabled)); }, ChangeEnabledStateItems: function(enabled){ ASPxClientButtonEditBase.prototype.ChangeEnabledStateItems.call(this, enabled); var btnElement = this.GetDropDownButton(); if(btnElement) aspxGetStateController().SetElementEnabled(btnElement, enabled); }, ChangeInputCellEnabledAttributes: function(element, method){ method(element, "onclick"); method(element, "onkeyup"); method(element, "onmousedown"); method(element, "onmouseup"); }, ChangeImageCellEnabledAttributes: function(imageCell, method){ method(imageCell, "onmousedown"); }, InitializeKeyHandlers: function() { this.AddKeyDownHandler(ASPxKey.Enter, "OnEnter"); this.AddKeyDownHandler(ASPxKey.Esc, "OnEscape"); this.AddKeyDownHandler(ASPxKey.PageUp, "OnPageUp"); this.AddKeyDownHandler(ASPxKey.PageDown, "OnPageDown"); this.AddKeyDownHandler(ASPxKey.End, "OnEndKeyDown"); this.AddKeyDownHandler(ASPxKey.Home, "OnHomeKeyDown"); this.AddKeyDownHandler(ASPxKey.Left, "OnArrowLeft"); this.AddKeyDownHandler(ASPxKey.Right, "OnArrowRight"); this.AddKeyDownHandler(ASPxKey.Up, "OnArrowUp"); this.AddKeyDownHandler(ASPxKey.Down, "OnArrowDown"); this.AddKeyDownHandler(ASPxKey.Tab, "OnTab"); }, OnArrowUp: function(evt){ if(evt.altKey) { this.ToggleDropDown(); return true; } return false; }, OnArrowDown: function(evt){ if(evt.altKey) { this.ToggleDropDown(); return true; } return false; }, OnPageUp: function(evt){ return false; }, OnPageDown: function(evt){ return false; }, OnEndKeyDown: function(evt){ return false; }, OnHomeKeyDown: function(evt){ return false; }, OnArrowLeft: function(evt){ return false; }, OnArrowRight: function(evt){ return false; }, OnEscape: function(evt){ if(__aspxFirefox && __aspxBrowserVersion >= 4) { var instance = this; window.setTimeout(function() { instance.OnEscapeInternal(); }, 0); } else this.OnEscapeInternal(); }, OnEscapeInternal: function() { var isCancelProcessed = this.OnCancelChanges() || this.droppedDown; this.HideDropDownArea(true); return isCancelProcessed; }, OnEnter: function(evt){ return false; }, OnTab: function(evt){ return false; }, RaiseCloseUp: function(){ if(!this.CloseUp.IsEmpty()){ var args = new ASPxClientEventArgs(); this.CloseUp.FireEvent(this, args); } }, RaiseDropDown: function(){ if(!this.DropDown.IsEmpty() && this.isInitialized){ var args = new ASPxClientEventArgs(); this.DropDown.FireEvent(this, args); } }, AdjustDropDownWindow: function(){ var pc = this.GetPopupControl(); if(pc) { if(__aspxIE && __aspxBrowserVersion >= 8) aspxGetPopupControlCollection().LockWindowResizeByBodyScrollVisibilityChanging(); pc.AdjustSize(); pc.UpdatePositionAtElement(this.GetMainElement()); if(__aspxIE && __aspxBrowserVersion >= 8) aspxGetPopupControlCollection().UnlockWindowResizeByBodyScrollVisibilityChanging(); } }, ResetDropDownSizeCache: function(){ this.ddHeightCache = __aspxInvalidDimension; this.ddWidthCache = __aspxInvalidDimension; }, ShowDropDown: function(){ this.ShowDropDownArea(false); }, HideDropDown: function(){ this.HideDropDownArea(false); } }); ASPxClientDropDownEdit = _aspxCreateClass(ASPxClientDropDownEditBase, { constructor: function(name) { this.constructor.prototype.constructor.call(this, name); this.dropDownWindowHeight = ""; this.dropDownWindowWidth = ""; this.allowFocusDropDownWindow = true; this.needAdjustControlsInDropDownWindow = true; }, InlineInitialize: function(){ this.InitSpecialKeyboardHandling(); ASPxClientDropDownEditBase.prototype.InlineInitialize.call(this); }, RefocusOnClickRequired: function(){ return __aspxIE; }, BeforePopupControlResizing: function() { var divContainer = this.GetDropDownDivContainer(); if(divContainer && this.needAdjustControlsInDropDownWindow) { this.AdjustControlsInDropDownWindow(); _aspxSetElementDisplay(divContainer, false); } }, AfterPopupControlResizing: function() { var divContainer = this.GetDropDownDivContainer(); if(divContainer && this.needAdjustControlsInDropDownWindow) { _aspxSetElementDisplay(divContainer, true); this.AdjustControlsInDropDownWindow(); this.needAdjustControlsInDropDownWindow = false; } }, AdjustControlsInDropDownWindow: function() { var pc = this.GetPopupControl(); var pcwElement = pc.GetWindowElement(-1); aspxGetControlCollection().ProcessControlsInContainer(pcwElement, function(control) { control.AdjustControl(false); }); }, GetDropDownDivContainer: function() { return _aspxGetElementById(this.name + __aspxDropDownNameSuffix + "_DDDC"); }, GetKeyValueInputElement: function(){ return _aspxGetElementById(this.name + "KV"); }, GetDropDownHeight: function(){ if(this.dropDownWindowHeight != "") return this.dropDownWindowHeight; return ASPxClientDropDownEditBase.prototype.GetDropDownHeight.call(this); }, GetDropDownWidth: function(){ if(this.dropDownWindowWidth != "") return this.dropDownWindowWidth; return this.GetMainElement().offsetWidth; }, CloseDropDownByDocumentOrWindowEvent: function(causedByWindowResizing){ if(!aspxGetPopupControlCollection().WindowResizeByBodyScrollVisibilityChangingLocked()) ASPxClientDropDownEditBase.prototype.CloseDropDownByDocumentOrWindowEvent.call(this, causedByWindowResizing); }, OnBrowserWindowResize: function(evt){ this.needAdjustControlsInDropDownWindow = true; }, OnEnter: function(evt){ return this.droppedDown; }, OnEscape: function(evt){ this.HideDropDownArea(true); return this.droppedDown; }, OnTextChanged: function() { this.OnValueChanged(); }, GetKeyValueInternal: function(){ var element = this.GetKeyValueInputElement(); if(element != null && element.value != "") return element.value; else return null; }, SetKeyValueInternal: function(keyValue){ var element = this.GetKeyValueInputElement(); if(element != null) element.value = keyValue; }, GetKeyValue: function(){ return this.GetKeyValueInternal(); }, SetKeyValue: function(keyValue){ this.SetKeyValueInternal(keyValue); } }); ASPxClientDropDownEdit.Cast = ASPxClientControl.Cast; ASPxClientDropDownCollection = _aspxCreateClass(ASPxClientControlCollection, { constructor: function(){ this.constructor.prototype.constructor.call(this); this.droppedControlName = ""; this.droppedParentNames = [ ]; this.focusedControlName = ""; }, SetFocusedDropDownName: function(name){ this.focusedControlName = name; }, ResetDroppedDownControl: function(){ this.droppedControlName = ""; }, ResetDroppedDownParentCollection: function(startDroppedDownControlName) { var regArray = [ ]; for(var i = 0; i < this.droppedParentNames.length; i++) { if(this.droppedParentNames[i] == startDroppedDownControlName) break; regArray.push(this.droppedParentNames[i]); } this.droppedParentNames = regArray; if(this.droppedParentNames.length > 0) { this.droppedControlName = this.droppedParentNames[this.droppedParentNames.length - 1]; _aspxArrayRemoveAt(this.droppedParentNames, this.droppedParentNames.length - 1); } }, ResetFocusedControl: function(){ this.focusedControlName = ""; }, GetFocusedDropDown: function(){ var control = this.GetDropDownControlInternal(this.focusedControlName); if(control == null) this.ResetFocusedControl(); return control; }, GetDroppedDropDown: function(){ var control = this.GetDropDownControlInternal(this.droppedControlName); if(control == null) this.ResetDroppedDownControl(); return control; }, GetDroppedDropDownParents: function(startDroppedDownControlName) { var dropDownArray = [ ]; var isNeedGetControl = false; for(var i = 0; i < this.droppedParentNames.length; i++) { if(this.droppedParentNames[i] == startDroppedDownControlName) isNeedGetControl = true; if(isNeedGetControl) var control = this.GetDropDownControlInternal(this.droppedParentNames[i]); if(control != null) dropDownArray.push(control); } return dropDownArray; }, FindFirstNameForClose: function(newDroppedDownParentArray) { var firstNameToClose = newDroppedDownParentArray.length > 0 ? "" : this.droppedParentNames[i]; for(var i = 0; i < this.droppedParentNames.length; i++) { if(_aspxArrayIndexOf(newDroppedDownParentArray, this.Get(this.droppedParentNames[i])) == -1) { firstNameToClose = this.droppedParentNames[i]; break; } } return firstNameToClose; }, GetDropDownControlInternal: function(name){ var control = this.Get(name); var isControlExists = control && control.RenderExistsOnPage(); if(!isControlExists) control = null; return control; }, IsDroppedDropDownParentExist: function(name) { for(var i = 0; i < this.droppedParentNames.length; i++) { if(this.droppedParentNames[i] == name) return true; } return false; }, OnDDButtonMouseMove: function(evt){ var dropDownControl = this.GetDroppedDropDown(); if(dropDownControl != null) dropDownControl.OnDDButtonMouseMove(evt); }, OnDocumentMouseDown: function(evt){ this.CloseDropDownByDocumentOrWindowEvent(evt, false); this.ClearFocusedDropDownByDocumentEvent(evt); }, OnDocumentMouseUp: function(evt){ var dropDownControl = this.GetDroppedDropDown(); if(dropDownControl != null) dropDownControl.OnDocumentMouseUp(); }, OnBrowserWindowResize: function(evt){ if(typeof(aspxGetPopupControlCollection) != "undefined" && !aspxGetPopupControlCollection().WindowResizeByBodyScrollVisibilityChangingLocked()){ this.CloseDropDownByDocumentOrWindowEvent(evt, true); this.AdjustControls(); } }, CloseDropDownByDocumentOrWindowEvent: function(evt, causedByWindowResizing){ var dropDownControl = this.GetDroppedDropDown(); if(dropDownControl != null && (this.IsEventNotFromControlSelf(evt, dropDownControl) || causedByWindowResizing)) dropDownControl.CloseDropDownByDocumentOrWindowEvent(causedByWindowResizing); var childrenDropDownsToClose = this.GetDroppedDropDownParents(this.droppedParentNames[0]); if(childrenDropDownsToClose.length != 0) { childrenDropDownsToClose = childrenDropDownsToClose.reverse(); this.ResetDroppedDownParentCollection(this.droppedParentNames[0]); var rollbackDroppedDownNames = [ ]; for(var c = 0; c < childrenDropDownsToClose.length; c++) { if(this.IsEventNotFromControlSelf(evt, childrenDropDownsToClose[c])) childrenDropDownsToClose[c].CloseDropDownByDocumentOrWindowEvent(causedByWindowResizing); else rollbackDroppedDownNames.push(childrenDropDownsToClose[c].name); } if(rollbackDroppedDownNames != 0) { rollbackDroppedDownNames = rollbackDroppedDownNames.reverse(); this.droppedParentNames = rollbackDroppedDownNames; } } }, ClearFocusedDropDownByDocumentEvent: function(evt){ var focusedDropDown = this.GetFocusedDropDown(); if(focusedDropDown != null && this.IsEventNotFromControlSelf(evt, focusedDropDown)) this.SetFocusedDropDownName(""); }, AdjustControls: function(){ this.ForEachControl(function(control) { control.AdjustControl(false); }); }, IsEventNotFromControlSelf: function(evt, control){ var srcElement = _aspxGetEventSource(evt); var mainElement = control.GetMainElement(); var popupControl = control.GetPopupControl(); if(!srcElement || !mainElement || !popupControl) return true; return (!_aspxGetIsParent(mainElement, srcElement) && !_aspxGetIsParent(popupControl.GetWindowElement(-1), srcElement)); }, RegisterDroppedDownControl: function(dropDownControl, droppedDownParentArray){ var prevDropDownControl = this.GetDroppedDropDown(); var areDroppedDownsCollectionParents = _aspxArrayIndexOf(droppedDownParentArray, prevDropDownControl) != -1; if(prevDropDownControl != null && prevDropDownControl != dropDownControl && !areDroppedDownsCollectionParents) prevDropDownControl.OnOpenAnotherDropDown(); if(this.droppedParentNames.length > 0) { var firstDropDownsNameToClose = this.FindFirstNameForClose(droppedDownParentArray); if(firstDropDownsNameToClose != "") { var childrenDropDownsToClose = this.GetDroppedDropDownParents(firstDropDownsNameToClose); this.ResetDroppedDownParentCollection(firstDropDownsNameToClose); this.CloseDroppedDownCollection(childrenDropDownsToClose.reverse()); } } this.droppedControlName = dropDownControl.name; this.droppedParentNames = [ ]; for(var i = 0; i < droppedDownParentArray.length; i++) this.droppedParentNames.push(droppedDownParentArray[i].name); }, UnregisterDroppedDownControl: function(dropDownControl){ if(this.droppedControlName == dropDownControl.name) this.ResetDroppedDownControl(); if(this.IsDroppedDropDownParentExist(dropDownControl.name)) { var prevDropDownControl = this.GetDroppedDropDown(); if(prevDropDownControl != null) prevDropDownControl.OnOpenAnotherDropDown(); var childrenDropDownsToClose = this.GetDroppedDropDownParents(dropDownControl.name); this.ResetDroppedDownParentCollection(dropDownControl.name); _aspxArrayRemoveAt(childrenDropDownsToClose, 0); this.CloseDroppedDownCollection(childrenDropDownsToClose.reverse()); } }, CloseDroppedDownCollection: function(dropDownParentArray) { for(var c = 0; c < dropDownParentArray.length; c++) dropDownParentArray[c].OnOpenAnotherDropDown(); } }); ASPxClientDateEdit = _aspxCreateClass(ASPxClientDropDownEditBase, { constructor: function(name) { this.constructor.prototype.constructor.call(this, name); this.dateFormatter = null; this.date = null; this.dateOnError = "u"; this.allowNull = true; this.calendarOwnerName = null; this.calendarConsumerName = null; this.textWasLastTemporaryChanged = false; this.DateChanged = new ASPxClientEvent(); this.ParseDate = new ASPxClientEvent(); }, Initialize: function() { if(this.calendarOwnerName == null) { var calendar = this.GetCalendar(); if(calendar) { calendar.SelectionChanging.AddHandler(ASPxClientDateEdit.HandleCalendarSelectionChanging); calendar.MainElementClick.AddHandler(ASPxClientDateEdit.HandleCalendarMainElementClick); var calendarMainElement = calendar.GetMainElement(); if (__aspxNetscapeFamily && _aspxIsExistsElement(calendarMainElement)) calendarMainElement.style.borderCollapse = "separate"; } } ASPxClientDropDownEditBase.prototype.Initialize.call(this); }, InlineInitialize: function(){ this.InitSpecialKeyboardHandling(); ASPxClientDropDownEditBase.prototype.InlineInitialize.call(this); }, OnDropDownCore: function(evt) { ASPxClientDropDownEditBase.prototype.OnDropDownCore.call(this, evt); if(this.droppedDown) { var cal = this.GetCalendar(); if(cal) cal.forceMouseDown = true; } }, ShowDropDownArea: function(isRaiseEvent){ var cal = this.GetCalendar(); if(cal) cal.SetValue(this.date); __aspxActiveCalendar = cal; ASPxClientDateEdit.active = this; ASPxClientDropDownEditBase.prototype.ShowDropDownArea.call(this, isRaiseEvent); var calendarOwner = this.GetCalendarOwner(); if(calendarOwner != null) calendarOwner.calendarConsumerName = this.name; this.calendarConsumerName = null; }, GetPopupControl: function() { var calendarOwner = this.GetCalendarOwner(); if(calendarOwner != null) return calendarOwner.GetPopupControl(); return ASPxClientDropDownEditBase.prototype.GetPopupControl.call(this); }, OnPopupControlShown: function() { if(this.calendarConsumerName != null) aspxGetControlCollection().Get(this.calendarConsumerName).OnPopupControlShown(); else ASPxClientDropDownEditBase.prototype.OnPopupControlShown.call(this); }, GetCalendar: function() { var name = this.GetDropDownInnerControlName(__aspxCalendarNameSuffix); return aspxGetControlCollection().Get(name); }, GetCalendarOwner: function() { if(!this.calendarOwnerName) return null; return aspxGetControlCollection().Get(this.calendarOwnerName); }, GetFormattedDate: function() { if(this.maskInfo != null) return this.maskInfo.GetValue(); if(this.date == null) return this.focused ? "" : this.nullText; return this.dateFormatter.Format(this.date); }, SetTextWasLastTemporaryChanged: function(value){ this.textWasLastTemporaryChanged = value; }, GetTextWasLastTemporaryChanged: function(){ return this.textWasLastTemporaryChanged; }, RaiseValueChangedEvent: function() { if(!this.isInitialized) return false; var processOnServer = ASPxClientEdit.prototype.RaiseValueChangedEvent.call(this); processOnServer = this.RaiseDateChanged(processOnServer); return processOnServer; }, OnApplyChanges: function(){ if(this.focused) this.OnTextChanged(); }, OnCalendarSelectionChanging: function(date, select) { if(!this.GetCalendar().isDateChangingByKeyboard) { this.HideDropDownArea(true); if(date != null) this.ApplyExistingTime(date); this.ChangeDate(date); if(select) _aspxSetSelection(this.GetInputElement()); } }, OnArrowUp: function(evt){ var isProcessed = ASPxClientDropDownEditBase.prototype.OnArrowUp.call(this, evt); if(!isProcessed && this.droppedDown) return this.OnCalendarMethod("OnArrowUp", evt); return false; }, OnArrowDown: function(evt){ var isProcessed = ASPxClientDropDownEditBase.prototype.OnArrowDown.call(this, evt); if(!isProcessed && this.droppedDown) return this.OnCalendarMethod("OnArrowDown", evt); return false; }, OnArrowLeft: function(evt){ if (this.droppedDown) { this.OnCalendarMethod("OnArrowLeft", evt); return true; } return false; }, OnArrowRight: function(evt){ if (this.droppedDown) { this.OnCalendarMethod("OnArrowRight", evt); return true; } return false; }, OnPageUp: function(evt){ if (this.droppedDown) { this.OnCalendarMethod("OnPageUp", evt); return true; } return false; }, OnPageDown: function(evt){ if (this.droppedDown) { this.OnCalendarMethod("OnPageDown", evt); return true; } return false; }, OnEndKeyDown: function(evt) { if (this.droppedDown) { this.OnCalendarMethod("OnEndKeyDown", evt); return true; } return false; }, OnHomeKeyDown: function(evt) { if (this.droppedDown) { this.OnCalendarMethod("OnHomeKeyDown", evt); return true; } return false; }, OnCalendarMethod: function(methodName, evt){ var calendar = this.GetCalendar(); if(!calendar.IsFastNavigationActive()) this.SetTextWasLastTemporaryChanged(false); return calendar[methodName](evt); }, OnKeyUp: function(evt){ if(ASPxFilteringUtils.EventKeyCodeChangesTheInput(evt)){ this.SetTextWasLastTemporaryChanged(true); } }, OnEnter: function() { this.enterProcessed = false; if (this.droppedDown) { var calendar = this.GetCalendar(); if (calendar.IsFastNavigationActive()) calendar.GetFastNavigation().OnEnter(); else if(this.GetTextWasLastTemporaryChanged()){ this.ParseValue(); this.HideDropDownArea(true); } else this.OnCalendarSelectionChanging(this.GetCalendar().GetValue(), true); this.enterProcessed = true; } else this.OnApplyChanges(); this.SetTextWasLastTemporaryChanged(false); return this.enterProcessed; }, OnEscape: function() { if (this.droppedDown){ if (this.GetCalendar().IsFastNavigationActive()) this.GetCalendar().OnEscape(); else this.HideDropDownArea(true); } else { this.ChangeDate(this.date); } this.SetTextWasLastTemporaryChanged(false); return true; }, OnTab: function(evt){ if(!this.droppedDown) return; var calendar = this.GetCalendar(); if (calendar.IsFastNavigationActive()) calendar.GetFastNavigation().Hide(); if(this.GetTextWasLastTemporaryChanged()){ this.ParseValue(); this.HideDropDownArea(true); } else this.OnCalendarSelectionChanging(this.GetCalendar().GetValue(), false); this.SetTextWasLastTemporaryChanged(false); }, ParseValue: function() { this.ParseValueCore(true); }, ParseValueCore: function(raiseChangedEvent) { var date; if(this.maskInfo != null) { date = _aspxMaskDateTimeHelper.GetDate(this.maskInfo); } else { var text = this.GetInputElement().value; var userParseResult = this.GetUserParsedDate(text); if(userParseResult !== false) { date = userParseResult; } else { if(text == null || text == "") date = null; else date = this.dateFormatter.Parse(text); } } this.ApplyParsedDate(date, raiseChangedEvent); }, GetUserParsedDate: function(text) { if(!this.ParseDate.IsEmpty()) { var args = new ASPxClientParseDateEventArgs(text); this.ParseDate.FireEvent(this, args); if(args.handled) return args.date; } return false; }, ApplyParsedDate: function(date, raiseChangedEvent) { if(date === false || !this.GetCalendar().IsDateInRange(date)) { switch(this.dateOnError) { case "n": date = null; break; case "t": date = new Date(); break; default: date = this.date; break; } } if(!this.allowNull && date == null) date = this.date; if(raiseChangedEvent) this.ChangeDate(date); else this.SetValue(date); }, ApplyExistingTime: function(date) { if(this.date == null) return; var savedDay = date.getDate(); date.setHours(this.date.getHours()); var diff = date.getDate() - savedDay; if(diff != 0) { var sign = (diff == 1 || date.getDate() == 1) ? -1 : 1; date.setTime(date.getTime() + sign * 3600000); } date.setMinutes(this.date.getMinutes()); date.setSeconds(this.date.getSeconds()); date.setMilliseconds(this.date.getMilliseconds()); }, GetValue: function() { return this.date; }, GetValueString: function() { return this.date != null ? _aspxGetInvariantDateTimeString(this.date) : null; }, SetValue: function(date) { this.date = date; if(this.maskInfo != null) { _aspxMaskDateTimeHelper.SetDate(this.maskInfo, date); this.ApplyMaskInfo(false); this.SavePrevMaskValue(); } else { this.GetInputElement().value = this.GetFormattedDate(); this.SyncRawInputValue(); if(this.CanApplyTextDecorators()) this.ToggleTextDecoration(); } if(this.styleDecoration) this.styleDecoration.Update(); }, ChangeDate: function(date) { var changed = !_aspxAreDatesEqualExact(this.date, date); this.SetValue(date); if(changed) { this.RaisePersonalStandardValidation(); this.OnValueChanged(); } }, GetText: function() { return this.GetFormattedDate(); }, SetText: function(value) { ASPxClientTextEdit.prototype.SetValue.call(this, value); if(this.maskInfo == null) this.ParseValueCore(false); }, ShouldCancelMaskKeyProcessing: function(htmlEvent, keyDownInfo) { if(htmlEvent.altKey) return true; if(ASPxClientDropDownEditBase.prototype.ShouldCancelMaskKeyProcessing.call(this, htmlEvent, keyDownInfo)) return true; if(!this.droppedDown) return false; return !_aspxMaskManager.IsPrintableKeyCode(keyDownInfo) && keyDownInfo.keyCode != ASPxKey.Backspace && keyDownInfo.keyCode != ASPxKey.Delete; }, DecodeRawInputValue: function(value) { if(value == "N") return null; var date = new Date(); date.setTime(Number(value)); return _aspxToUtcTime(date); }, SyncRawInputValue: function() { this.GetRawInputElement().value = this.date == null ? "N" : _aspxToLocalTime(this.date).valueOf(); }, HasTextDecorators: function() { return (this.maskInfo != null && this.date == null) || ASPxClientDropDownEditBase.prototype.HasTextDecorators.call(this); }, GetMaskDisplayText: function() { if(!this.focused) { if(this.date == null) return this.nullText; if(this.HasTextDecorators()) return this.GetDecoratedText(this.date); } return this.maskInfo.GetText(); }, ToggleTextDecorationCore: function() { if(this.maskInfo != null) { this.ApplyMaskInfo(false); } else { var text; var input = this.GetInputElement(); if(this.focused) { text = this.GetFormattedDate(); } else { if(this.date == null) text = this.nullText; else if(this.displayFormat != null) text = ASPxFormatter.Format(this.displayFormat, this.date); else text = this.GetFormattedDate(); } if(input.value != text) input.value = text; } }, RaiseDateChanged: function(processOnServer) { if(!this.DateChanged.IsEmpty()) { var args = new ASPxClientProcessingModeEventArgs(processOnServer); this.DateChanged.FireEvent(this, args); processOnServer = args.processOnServer; } return processOnServer; }, SetDate: function(date) { this.SetValue(date); }, GetDate: function() { return this.date ? new Date(this.date.valueOf()) : null; }, GetMinDate: function() { var cal = this.GetCalendar(); if(cal) return cal.GetMinDate(); return null; }, SetMinDate: function(date) { var cal = this.GetCalendar(); if(cal) cal.SetMinDate(date); }, GetMaxDate: function() { var cal = this.GetCalendar(); if(cal) return cal.GetMaxDate(); return null; }, SetMaxDate: function(date) { var cal = this.GetCalendar(); if(cal) cal.SetMaxDate(date); } }); ASPxClientDateEdit.Cast = ASPxClientControl.Cast; ASPxClientDateEdit.active = null; ASPxClientDateEdit.HandleCalendarSelectionChanging = function(s, e) { if(ASPxClientDateEdit.active == null) return; ASPxClientDateEdit.active.OnCalendarSelectionChanging(e.selection.GetFirstDate(), true); }; ASPxClientDateEdit.HandleCalendarMainElementClick = function(s, e) { if(ASPxClientDateEdit.active == null) return; ASPxClientDateEdit.active.SetFocus(); }; ASPxClientParseDateEventArgs = _aspxCreateClass(ASPxClientEventArgs, { constructor: function(value) { this.constructor.prototype.constructor.call(this); this.value = value; this.date = null; this.handled = false; } }); __aspxCCValueInputSuffix = "VI"; ASPxClientComboBoxBase = _aspxCreateClass(ASPxClientDropDownEditBase, { constructor: function(name) { this.constructor.prototype.constructor.call(this, name); this.lbEventLockCount = 0; this.receiveGlobalMouseWheel = false; this.listBox = null; this.lastSuccessValue = ""; this.islastSuccessValueInit = false; this.SelectedIndexChanged = new ASPxClientEvent(); }, Initialize: function(){ this.InitializeListBoxOwnerName(); ASPxClientDropDownEditBase.prototype.Initialize.call(this); this.InitLastSuccessValue(); }, InitializeListBoxOwnerName: function(){ var lb = this.GetListBoxControl(); if(lb) lb.ownerName = this.name; }, InitLastSuccessValue: function(){ this.SetLastSuccessValue(this.GetValue()); }, SetLastSuccessValue: function(value){ this.lastSuccessValue = value; this.islastSuccessValueInit = true; }, GetDropDownInnerControlName: function(suffix){ return ""; }, GetListBoxControl: function(){ if(!_aspxIsExists(this.listBox)){ var name = this.GetDropDownInnerControlName(__aspxListBoxNameSuffix); this.listBox = aspxGetControlCollection().Get(name); } return this.listBox; }, GetCallbackArguments: function(){ return this.GetListBoxCallbackArguments(); }, GetListBoxCallbackArguments: function(){ var lb = this.GetListBoxControl(); return lb.GetCallbackArguments(); }, SendCallback: function(){ this.CreateCallback(this.GetCallbackArguments()); }, SendSpecialCallback: function(args){ this.CreateCallback(args); }, SetText: function (text){ var lb = this.GetListBoxControl(); var index = this.GetAdjustedSelectedIndexByText(lb, text); this.SelectIndex(index, false); this.SetTextBase(text); this.SetLastSuccessTest(text); this.SetLastSuccessValue(index >= 0 ? lb.GetValue() : text); }, GetValue: function(){ var value = this.islastSuccessValueInit ? this.lastSuccessValue : this.GetValueInternal(); if(this.convertEmptyStringToNull && value === "") value = null; return value; }, GetValueInternal: function(){ var text = this.GetTextInternal(); var textChanges = text != this.lastSuccessText; if(textChanges){ var lb = this.GetListBoxControl(); if (lb){ var index = this.GetAdjustedSelectedIndexByText(lb, text); this.SelectIndexSilent(lb, index); if(index != -1) return lb.GetValue(); } } return ASPxClientDropDownEditBase.prototype.GetValue.call(this); }, SetValue: function(value){ var lb = this.GetListBoxControl(); if(lb){ lb.SetValue(value); var item = lb.GetSelectedItem(); var text = item ? item.text : value; this.OnSelectionChangedCore(text, item, false); this.UpdateValueInput(); } }, GetAdjustedSelectedIndexByText: function(lb, text){ var lbSelectedItem = lb.GetSelectedItem(); if(lbSelectedItem != null && lbSelectedItem.text == text) return lbSelectedItem.index; return this.FindItemIndexByText(lb, text); }, FindItemIndexByText: function(lb, text){ if (lb) return lb.FindItemIndexByText(text); }, CollectionChanged: function(){ }, SelectIndex: function(index, initialize){ var lb = this.GetListBoxControl(); var isSelectionChanged = lb.SelectIndexSilentAndMakeVisible(index, initialize); var item = lb.GetSelectedItem(); var text = item != null ? item.text : ""; if(isSelectionChanged) this.OnSelectionChangedCore(text, item, false); this.UpdateValueInput(); return isSelectionChanged; }, OnSelectChanged: function(){ if(this.lbEventLockCount > 0) return; var lb = this.GetListBoxControl(); var item = lb.GetSelectedItem(); var text = item != null ? item.text : ""; this.OnSelectionChangedCore(text, item, false); this.OnChange(); }, OnSelectionChangedCore: function(text, item, canBeRolledBack){ this.SetTextBase(text); this.ShowItemImage(item); if(!canBeRolledBack){ this.SetLastSuccessTest(text); this.SetLastSuccessValue(item != null ? item.value : text); } if(this.filterStrategy) { if(!canBeRolledBack) this.filterStrategy.OnSelectionChanged(); if(__aspxIE) { var inputElement = this.GetInputElement(); if(_aspxGetActiveElement() == inputElement) _aspxSetInputSelection(inputElement, inputElement.value.length, inputElement.value.length); } } }, ShowItemImageByIndex: function(index){ var item = this.GetItem(index); this.ShowItemImage(item); }, ShowItemImage: function(item){ var imageUrl = item != null ? item.imageUrl : ""; this.SetSelectedImage(imageUrl); }, GetDropDownImageElement: function(){ var itemImageCell = this.GetDropDownItemImageCell(); if(itemImageCell != null) return _aspxGetChildByTagName(itemImageCell, "IMG", 0); return null; }, SetSelectedImage: function(imageUrl) { var imgElement = this.GetDropDownImageElement(); if(imgElement != null) { var imageExists = imageUrl != ""; imageUrl = imageExists ? imageUrl : ASPx.EmptyImageUrl; imgElement.src = imageUrl; var itemImageCell = this.GetDropDownItemImageCell(); if(_aspxGetElementDisplay(itemImageCell) != imageExists) _aspxSetElementDisplay(itemImageCell, imageExists); if(__aspxIE) { this.AdjustControl(); } } }, OnCallback: function(result) { }, OnChange: function(){ this.UpdateValueInput(); this.RaisePersonalStandardValidation(); this.OnValueChanged(); }, UpdateValueInput: function() { }, RaiseValueChangedEvent: function() { if(!this.isInitialized) return; var processOnServer = ASPxClientTextEdit.prototype.RaiseValueChangedEvent.call(this); processOnServer = this.RaiseSelectedIndexChanged(processOnServer); return processOnServer; }, RaiseSelectedIndexChanged: function(processOnServer) { if(!this.SelectedIndexChanged.IsEmpty()){ var args = new ASPxClientProcessingModeEventArgs(processOnServer); this.SelectedIndexChanged.FireEvent(this, args); processOnServer = args.processOnServer; } return processOnServer; }, AddItem: function(text, value, imageUrl){ var index = this.GetListBoxControl().AddItem(text, value, imageUrl); this.CollectionChanged(); return index; }, InsertItem: function(index, text, value, imageUrl){ this.GetListBoxControl().InsertItem(index, text, value, imageUrl); this.CollectionChanged(); }, RemoveItem: function(index){ this.GetListBoxControl().RemoveItem(index); this.CollectionChanged(); }, ClearItems: function(){ this.GetListBoxControl().ClearItems(); this.ClearItemsInternal(); }, BeginUpdate: function(){ this.GetListBoxControl().BeginUpdate(); }, EndUpdate: function(){ this.GetListBoxControl().EndUpdate(); this.CollectionChanged(); }, MakeItemVisible: function(index){ }, GetItem: function(index){ return this.GetListBoxControl().GetItem(index); }, FindItemByText: function(text){ return this.GetListBoxControl().FindItemByText(text); }, FindItemByValue: function(value){ return this.GetListBoxControl().FindItemByValue(value); }, GetItemCount: function(){ return this.GetListBoxControl().GetItemCount(); }, GetSelectedIndex: function(){ return this.GetListBoxControl().GetSelectedIndex(); }, SetSelectedIndex: function(index){ this.SelectIndex(index, false); }, GetSelectedItem: function(){ var lb = this.GetListBoxControl(); var index = lb.GetSelectedIndex(); return lb.GetItem(index); }, SetSelectedItem: function(item){ var index = (item != null) ? item.index : -1; this.SelectIndex(index, false); }, GetText: function(){ return this.lastSuccessText; }, PerformCallback: function(arg) { }, ClearItemsInternal: function(){ this.SetValue(null); this.CollectionChanged(); } }); ASPxClientComboBox = _aspxCreateClass(ASPxClientComboBoxBase, { constructor: function(name) { this.constructor.prototype.constructor.call(this, name); this.allowMultipleCallbacks = false; this.isCallbackMode = false; this.isPerformCallback = false; this.changeSelectAfterCallback = 0; this.incrementalFilteringMode = "None"; this.filterStrategy = null; this.filterTimer = __aspxTouchUI ? 300 : 100; this.filterMinLength = 0; this.initTextCorrectionRequired = false; this.isDropDownListStyle = true; this.defaultDropDownHeight = ""; this.dropDownHeight = ""; this.dropDownWidth = ""; this.dropDownRows = 7; this.enterKeyPressed = false; }, Initialize: function(){ var lb = this.GetListBoxControl(); this.InitializeListBoxOwnerName(); this.FilterStrategyInitialize(); var mainElement = this.GetMainElement(); var input = this.GetInputElement(); var ddbutton = this.GetDropDownButton(); if(this.isDropDownListStyle && __aspxIE){ _aspxPreventElementDragAndSelect(mainElement, true, true); _aspxPreventElementDragAndSelect(input, true, true); if(ddbutton) _aspxPreventElementDragAndSelect(ddbutton, true); } if(this.isToolbarItem){ if(__aspxIE && __aspxBrowserVersion == 9) input.onmousedown = function(evt) { _aspxPreventEvent(evt); }; else { mainElement.unselectable="on"; input.unselectable="on"; if(input.offsetParent) input.offsetParent.unselectable="on"; if(ddbutton) ddbutton.unselectable="on"; if(lb){ var table = lb.GetListTable(); for(var i = 0; i < table.rows.length; i ++){ for(var j = 0; j < table.rows[i].cells.length; j ++) _aspxSetElementAsUnselectable(table.rows[i].cells[j], true); } } } } this.RemoveRaisePSValidationFromListBox(); this.RedirectStandardValidators(); this.InitListBoxScrollStyle(); ASPxClientComboBoxBase.prototype.Initialize.call(this); }, FilterStrategyInitialize: function() { if(this.incrementalFilteringMode == "Contains") this.filterStrategy = new ASPxContainsFilteringStrategy(this); else if(this.incrementalFilteringMode == "StartsWith") this.filterStrategy = new ASPxStartsWithFilteringStrategy(this); else if(this.incrementalFilteringMode == "None") this.filterStrategy = new ASPxComboBoxDisableFilteringStrategy(this); else this.filterStrategy = null; this.filterStrategy.Initialize(); }, InlineInitialize: function(){ this.InsureInputValueCorrect(); this.InitSpecialKeyboardHandling(); ASPxClientComboBoxBase.prototype.InlineInitialize.call(this); }, InsureInputValueCorrect: function(){ if(this.initTextCorrectionRequired){ var lb = this.GetListBoxControl(); if(lb){ var initSelectedIndex = lb.GetSelectedIndexInternal(); if(initSelectedIndex >= 0){ var initSelectedText = lb.GetItem(initSelectedIndex).text; var input = this.GetInputElement(); var rawInput = this.GetRawInputElement(); if(rawInput && rawInput.value != initSelectedText){ rawInput.value = initSelectedText; input.value = this.GetDecoratedText(initSelectedText); } else if(input.value != initSelectedText) input.value = initSelectedText; } } } }, ChangeEnabledAttributes: function(enabled){ ASPxClientComboBoxBase.prototype.ChangeEnabledAttributes.call(this, enabled); var changeEventsMethod = _aspxChangeEventsMethod(enabled); var mainElement = this.GetMainElement(); if(mainElement) changeEventsMethod(mainElement, _aspxGetMouseWheelEventName(), aspxCBMouseWheel); var btnElement = this.GetDropDownButton(); if(btnElement) changeEventsMethod(btnElement, "onmousemove", aspxCBDDButtonMMove); }, GetDropDownInnerControlName: function(suffix){ return ASPxClientDropDownEditBase.prototype.GetDropDownInnerControlName.call(this, suffix); }, AdjustControlCore: function() { ASPxClientEdit.prototype.AdjustControlCore.call(this); this.ResetDropDownSizeCache(); }, RemoveRaisePSValidationFromListBox: function() { var listBox = this.GetListBoxControl(); if (listBox) listBox.RaisePersonalStandardValidation = function() { }; }, RedirectStandardValidators: function() { var valueInput = this.GetValueInput(); if(_aspxIsExistsElement(valueInput) && valueInput.Validators) { for(var i = 0; i < valueInput.Validators.length; i++) valueInput.Validators[i].controltovalidate = valueInput.id; } }, GetValueInputToValidate: function(){ return this.GetValueInput(); }, GetValueInput: function(){ return document.getElementById(this.name + "_" + __aspxCCValueInputSuffix); }, GetListBoxScrollDivElement: function(){ return this.GetListBoxControl().GetScrollDivElement(); }, RollbackValueInputValue: function(){ var inputElement = this.GetValueInput(); if(inputElement){ inputElement.value = this.lastSuccessValue; } }, UpdateValueInput: function() { var inputElement = this.GetValueInput(); if(inputElement){ var value = this.GetValue(); inputElement.value = value != null ? value : ""; } }, VisibleCollectionChanged: function(){ this.CollectionChangedCore(); }, CollectionChanged: function(){ this.CollectionChangedCore(); }, CollectionChangedCore: function(byTimer){ if(this.GetListBoxControl().APILockCount == 0){ this.UpdateDropDownPositionAndSize(); if(__aspxIE){ var lb = this.GetListBoxControl(); var selectedIndex = lb.GetSelectedIndex(); if(selectedIndex > -1){ var selectedItemTextCell = lb.GetItemFirstTextCell(selectedIndex); var controller = aspxGetStateController(); controller.DeselectElementBySrcElement(selectedItemTextCell); controller.SelectElementBySrcElement(selectedItemTextCell); } } } }, UpdateDropDownPositionAndSize: function(){ this.InitDropDownSize(); if(this.droppedDown){ var pc = this.GetPopupControl(); var element = this.GetMainElement(); pc.UpdatePositionAtElement(element); } }, InitListBoxScrollStyle: function(){ this.PreventScrollSpoilDDShowing(); }, GetDropDownHeight: function(){ return (this.ddHeightCache != __aspxInvalidDimension) ? this.ddHeightCache : this.InitListBoxHeight(); }, GetDropDownWidth: function(){ return (this.ddWidthCache != __aspxInvalidDimension && !this.GetIsControlWidthWasChanged()) ? this.ddWidthCache : this.InitListBoxWidth(); }, InitDropDownSize: function(){ if(!this.enabled || this.GetItemCount() == 0) return; var pc = this.GetPopupControl(); if(pc && this.IsDisplayed()) { var pcwElement = pc.GetWindowElement(-1); if(_aspxIsExistsElement(pcwElement)){ var isPcwDisplayed = _aspxGetElementDisplay(pcwElement); if(!isPcwDisplayed) pc.SetWindowDisplay(-1, true); this.ddHeightCache = this.InitListBoxHeight(); this.ddWidthCache = this.InitListBoxWidth(); pc.SetSize(this.ddWidthCache, this.ddHeightCache); if(!isPcwDisplayed) pc.SetWindowDisplay(-1, false); } } }, InitMainElementCache: function(){ this.mainElementWidthCache = this.GetMainElement().clientWidth; }, GetVisibleItemCount: function(lb){ var lbTable = lb.GetListTable(); var count = this.GetItemCount(); var visibleItemCount = 0; for(var i = 0; i < count; i ++){ if(_aspxGetElementDisplay(lbTable.rows[i])) visibleItemCount++; } return visibleItemCount; }, GetDefaultDropDownHeight: function(listHeight, count){ if(this.defaultDropDownHeight == ""){ this.defaultDropDownHeight = ((listHeight / count) * this.dropDownRows) + "px"; } return this.defaultDropDownHeight; }, InitListBoxHeight: function(){ var lbScrollDiv = this.GetListBoxScrollDivElement(); var height = this.dropDownHeight; var lb = this.GetListBoxControl(); lb.GetMainElement().style.height = "0px"; var lbHeight = 0; if(height == ""){ var listHeight = lb.GetListTableHeight(); var count = this.GetVisibleItemCount(lb); if(count > this.dropDownRows) height = this.GetDefaultDropDownHeight(listHeight, count); else height = count == 0 ? "0px" : listHeight + "px"; lbScrollDiv.style.height = height; lbHeight = lbScrollDiv.offsetHeight; } else { var lbMainElement = lb.GetMainElement(); lbMainElement.style.height = "0px"; lbScrollDiv.style.height = "0px"; lbMainElement.style.height = height; var trueLbOffsetHeight = lbMainElement.offsetHeight; var trueLbClientHeight = lbMainElement.clientHeight; lbScrollDiv.style.height = lbMainElement.clientHeight + "px"; lbHeightCorrection = lbMainElement.offsetHeight - trueLbOffsetHeight; lbScrollDiv.style.height = (trueLbClientHeight - lbHeightCorrection) + "px"; lbHeight = lbMainElement.offsetHeight; } lb.InitializePageSize(); return lbHeight; }, InitListBoxWidth: function(){ this.InitMainElementCache(); var mainElement = this.GetMainElement(); var lbScrollDiv = this.GetListBoxScrollDivElement(); var lb = this.GetListBoxControl(); var lbMainElement = lb.GetMainElement(); var lbTable = lb.GetListTable(); var scrollWidth = 0; lbMainElement.style.width = ""; lbScrollDiv.style.paddingRight = "0px"; lbScrollDiv.style.width = "100%"; if(this.dropDownWidth != ""){ lbMainElement.style.width = this.dropDownWidth; var width = lbMainElement.clientWidth; var scrollInfo = this.SetLbScrollDivAndCorrectionForScroll(lb, width, false); width = scrollInfo.scrollDivWidth; scrollWidth = scrollInfo.scrollWidth; if(!__aspxIE) { var difference = lbTable.offsetWidth - lbScrollDiv.clientWidth; if(difference > 0){ lbMainElement.style.width = (lbMainElement.offsetWidth + difference) + "px"; lbScrollDiv.style.width = (lbMainElement.clientWidth) + "px"; } } } else { var width = lbTable.offsetWidth; var scrollInfo = this.SetLbScrollDivAndCorrectionForScroll(lb, width, true); width = scrollInfo.scrollDivWidth; scrollWidth = scrollInfo.scrollWidth; if(__aspxFirefox && lbMainElement.offsetWidth < lbScrollDiv.offsetWidth) lbMainElement.style.width = "0%"; var widthDifference = mainElement.offsetWidth - lbMainElement.offsetWidth; if(widthDifference > 0){ lbScrollDiv.style.width = (width + widthDifference) + "px"; var twoBorderSize = (lbMainElement.offsetWidth - lbMainElement.clientWidth); lbMainElement.style.width = (width + widthDifference + twoBorderSize) + "px"; } } if(lb.IsMultiColumn()) lb.CorrectMultiColumnHeaderWidth(scrollWidth); return lbScrollDiv.offsetWidth; }, SetLbScrollDivAndCorrectionForScroll: function(lb, width, widthByContent){ var lbScrollDiv = this.GetListBoxScrollDivElement(); var scrollWidth = lb.GetVerticalScrollBarWidth(); var browserPutsScrollBarOnContent = __aspxIE && __aspxBrowserVersion > 5.5 && __aspxBrowserVersion < 8; var browserCanHaveScroll = lb.GetVerticalOverflow(lbScrollDiv) == "auto" || this.IsScrollSpoilDDShowing(); if(browserPutsScrollBarOnContent) { width -= scrollWidth; lbScrollDiv.style.paddingRight = scrollWidth + "px"; } else if(widthByContent && browserCanHaveScroll) width += scrollWidth; lbScrollDiv.style.width = width + "px"; return {scrollDivWidth: width, scrollWidth: scrollWidth}; }, SelectIndexSilent: function(lb, index){ this.lbEventLockCount ++; lb.SelectIndexSilentAndMakeVisible(index); this.ShowItemImageByIndex(index); this.lbEventLockCount --; }, GetDecoratedText: function(value){ var selectedItem = this.GetSelectedItem(); var lb = this.GetListBoxControl(); if(this.displayFormat != null && lb.IsMultiColumn() && selectedItem != null){ var textColumnCount = lb.GetItemTextCellCount(); var texts = [textColumnCount]; for(var i = 0; i < textColumnCount; i++){ texts[i] = selectedItem.GetColumnTextByIndex(i) } return ASPxFormatter.Format(this.displayFormat, texts); } else return ASPxClientComboBoxBase.prototype.GetDecoratedText.call(this, value); }, ShowDropDownArea: function(isRaiseEvent){ var lb = this.GetListBoxControl(); if(!lb || lb.GetItemCount() == 0) return; if(!this.filterStrategy.IsShowDropDownAllowed()) { this.DropDownButtonPop(true); return; } ASPxClientDropDownEditBase.prototype.ShowDropDownArea.call(this, isRaiseEvent); var rawText = this.GetTextInternal(); var lbItem = lb.GetSelectedItem(); var lbText = lbItem != null ? lbItem.text : ""; if(rawText != lbText && rawText != null && lbText != ""){ var newSelectedIndex = this.GetAdjustedSelectedIndexByText(lb, rawText); lb.SelectIndexSilent(newSelectedIndex, false); } this.EnsureSelectedItemVisibleOnShow(lb); lb.CallbackSpaceInit(); }, FireFoxRequiresCacheScrollBar: function(){ return __aspxFirefox && __aspxBrowserVersion >= 3.6; }, BrowserRequiresCacheScrollBar: function(){ return __aspxWebKitFamily || __aspxOpera || this.FireFoxRequiresCacheScrollBar(); }, HideDropDownArea: function(isRaiseEvent){ if(this.filterStrategy) this.filterStrategy.OnBeforeHideDropDownArea(); if(this.BrowserRequiresCacheScrollBar()) this.CachedScrollTop(); ASPxClientDropDownEditBase.prototype.HideDropDownArea.call(this, isRaiseEvent); this.PreventScrollSpoilDDShowing(); }, EnsureSelectedItemVisibleOnShow: function(listBox){ if(this.BrowserRequiresCacheScrollBar()) listBox.RestoreScrollTopFromCache(); listBox.EnsureSelectedItemVisible(); }, CachedScrollTop: function(){ this.GetListBoxControl().CachedScrollTop(); if(this.BrowserRequiresCacheScrollBar()){ var scrollDiv = this.GetListBoxScrollDivElement(); if(scrollDiv != null) scrollDiv.scrollTop = 0; } }, IsScrollSpoilDDShowing: function (){ var pc = this.GetPopupControl(); if(pc) return (__aspxNetscapeFamily && pc.enableAnimation); }, EnableLBDivOverflow: function(){ var divElement = this.GetListBoxScrollDivElement(); divElement.style.overflow = "auto"; }, DisableLBDivOverflow: function(){ var divElement = this.GetListBoxScrollDivElement(); divElement.style.overflow = "hidden"; }, PreventScrollSpoilDDShowing: function(){ if(this.IsScrollSpoilDDShowing()) this.DisableLBDivOverflow(); }, IsFilterEnabled: function() { return this.incrementalFilteringMode != "None"; }, ChangeInputEnabled: function(element, enabled, readOnly){ ASPxClientTextEdit.prototype.ChangeInputEnabled.call(this, element, enabled, readOnly || (this.isDropDownListStyle && !this.IsFilterEnabled())); }, GetCallbackArguments: function(){ var args = ASPxClientComboBoxBase.prototype.GetCallbackArguments.call(this); args += this.GetCallbackArgumentsInternal(); return args; }, GetCallbackArgumentsInternal: function(){ var args = ""; args = this.filterStrategy.GetCallbackArguments(); return args; }, ShowLoadingPanel: function() { var lb = this.GetListBoxControl(); var loadingParentElement = lb.GetScrollDivElement().parentNode; if(!this.loadingDivElement) this.CreateLoadingDiv(loadingParentElement); if(!this.loadingPanelElement) this.CreateLoadingPanelWithAbsolutePosition(loadingParentElement, loadingParentElement); }, HideLoadingPanelOnCallback: function(){ return false; }, OnCallback: function(result) { if(__aspxTouchUI) window.setTimeout(function(){ this.OnCallbackCore(result); }.aspxBind(this), 0); else this.OnCallbackCore(result); }, OnCallbackCore: function(result) { if(this.filterStrategy.IsCallbackResultNotDiscarded()) { this.OnCallbackBeforeListBox(); this.GetListBoxControl().OnCallback(result); this.OnCallbackInternal(result); this.OnCallbackFinally(true); } }, DoEndCallback: function(){ this.filterStrategy.BeforeDoEndCallback(); ASPxClientDropDownEditBase.prototype.DoEndCallback.call(this); this.filterStrategy.AfterDoEndCallback(); }, RaiseEndCallback: function(){ if(this.preventEndCallbackRising) this.preventEndCallbackRising = false; else ASPxClientDropDownEditBase.prototype.RaiseEndCallback.call(this); }, OnCallbackError: function(result, data){ this.GetListBoxControl().OnCallbackError(result); this.OnCallbackFinally(false); }, OnCallbackFinally: function(isSuccessful){ this.filterStrategy.OnBeforeCallbackFinally(); this.CollectionChanged(); this.HideLoadingDiv(); this.HideLoadingPanel(); this.isPerformCallback = false; this.changeSelectAfterCallback = 0; if(isSuccessful) this.filterStrategy.OnAfterCallbackFinally(); }, OnCallbackBeforeListBox: function(){ var lb = this.GetListBoxControl(); this.changeSelectAfterCallback = lb.changeSelectAfterCallback; }, OnCallbackCorrectSelectedIndex: function(){ var lb = this.GetListBoxControl(); if(this.changeSelectAfterCallback != 0) this.SetTextInternal(lb.GetSelectedItem().text); }, OnCallbackInternal: function(result){ this.OnCallbackCorrectSelectedIndex(); if(this.isPerformCallback) { var lb = this.GetListBoxControl(); var resultIsEmpty = lb.GetItemCount() == 0; if(resultIsEmpty) this.HideDropDownArea(true); else if(this.isDropDownListStyle) this.SelectIndex(0); } this.filterStrategy.OnCallbackInternal(result); }, IsDropDownButtonClick: function(evt) { return _aspxGetIsParent(this.GetDropDownButton(), _aspxGetEventSource(evt)); }, OnDropDown: function(evt) { var returnValue = ASPxClientDropDownEditBase.prototype.OnDropDown.call(this, evt); if(this.IsDropDownButtonClick(evt)) { this.OnDropDownButtonClick(); return returnValue; } return true; }, OnDropDownButtonClick: function() { if(this.filterStrategy != null) this.filterStrategy.OnDropDownButtonClick(); this.ForceRefocusEditor(); }, SendCallback: function(){ if(!this.pcIsShowingNow) this.ShowLoadingPanel(); ASPxClientComboBoxBase.prototype.SendCallback.call(this); }, SelectNeighbour: function (step){ if((this.isToolBarItem && !this.droppedDown) || this.readOnly) return; var lb = this.GetListBoxControl(); var step = this.filterStrategy.GetStepForClientFiltrationEnabled(lb, step); this.SelectNeighbourInternal(lb, step); }, SelectNeighbourInternal: function(lb, step){ if(this.droppedDown) this.lbEventLockCount ++; lb.SelectNeighbour(step); if(this.droppedDown){ var selectedItem = lb.GetSelectedItem(); this.OnSelectionChangedCore(selectedItem.text, selectedItem, true); this.lbEventLockCount --; } }, GetFocusSelectAction: function() { return this.isToolbarItem ? null : "all"; }, OnSpecialKeyDown: function(evt){ if(this.filterStrategy) this.filterStrategy.OnSpecialKeyDown(evt); return ASPxClientEdit.prototype.OnSpecialKeyDown.call(this, evt); }, OnArrowUp: function(evt){ if(!this.isInitialized) return true; var isProcessed = ASPxClientDropDownEditBase.prototype.OnArrowUp.call(this, evt); if (!isProcessed && this.filterStrategy.IsFilterMeetRequirementForMinLength()) this.SelectNeighbour(-1); return true; }, OnTextChanged: function(){ if(!this.IsFocusEventsLocked()) ASPxClientComboBoxBase.prototype.OnTextChanged.call(this); }, OnTextChangedInternal: function() { ASPxClientComboBoxBase.prototype.OnTextChangedInternal.call(this); this.filterStrategy.OnTextChanged(); }, OnArrowDown: function(evt){ if(!this.isInitialized) return true; var isProcessed = ASPxClientDropDownEditBase.prototype.OnArrowDown.call(this, evt); if (!isProcessed && this.filterStrategy.IsFilterMeetRequirementForMinLength()) this.SelectNeighbour(1); return true; }, OnPageUp: function(){ if(!this.isInitialized || !this.filterStrategy.IsFilterMeetRequirementForMinLength()) return true; return this.OnPageButtonDown(false); }, OnPageDown: function(){ if(!this.isInitialized || !this.filterStrategy.IsFilterMeetRequirementForMinLength()) return true; return this.OnPageButtonDown(true); }, OnPageButtonDown: function(isDown){ if(!this.isInitialized) return true; var lb = this.GetListBoxControl(); if(lb){ var direction = isDown ? 1 : -1; this.SelectNeighbour(lb.scrollPageSize * direction); } return true; }, OnHomeKeyDown: function(evt){ if(!this.isInitialized) return true; return this.OnHomeEndKeyDown(evt, true); }, OnEndKeyDown: function(evt){ if(!this.isInitialized) return true; return this.OnHomeEndKeyDown(evt, false); }, OnHomeEndKeyDown: function(evt, isHome){ if(!this.isInitialized) return true; var input = this.GetValueInput(); if(input.readOnly || evt.ctrlKey){ var lb = this.GetListBoxControl(); var count = lb.GetItemCount(); this.SelectNeighbour(isHome ? -count : count); return true; } return false; }, OnEscape: function() { this.filterStrategy.OnEscape(); ASPxClientComboBoxBase.prototype.OnEscape.call(this); }, OnEnter: function(){ if(!this.isInitialized) return true; if(this.isDropDownListStyle) this.enterKeyPressed = true; if(this.filterStrategy.IsCloseByEnterLocked()) return; this.enterProcessed = this.droppedDown; if(!this.isEnterLocked) { this.OnApplyChangesAndCloseWithEvents(true); this.filterStrategy.OnAfterEnter(); } return this.enterProcessed; }, OnTab: function(evt){ if(!this.isInitialized) return true; this.filterStrategy.OnTab(); }, OnApplyChanges: function(){ if(!this.focused || (this.isDropDownListStyle && !this.IsFilterEnabled())) return; this.OnApplyChangesInternal(); }, OnApplyChangesAndCloseWithEvents: function (withoutCallback) { this.OnApplyChangesInternal(withoutCallback); this.HideDropDownArea(true); }, OnApplyChangesInternal: function(withoutCallback){ var inCallback = this.InCallback(); var lb = this.GetListBoxControl(); var text = this.GetInputElement().value; var isChanged = this.lastSuccessText != text; var isRollback = false; if(isChanged){ var rollbackRequired = this.isDropDownListStyle && this.GetAdjustedSelectedIndexByText(lb, text) < 0; if(rollbackRequired) { var rollbackToItem = lb.GetSelectedItem(); isRollback = rollbackToItem == null && this.isCallbackMode; if(isRollback) { this.RollbackValueInputValue(); this.RollbackTextInputValue(); } text = rollbackToItem != null ? rollbackToItem.text : this.lastSuccessText; } if(!isRollback) this.SetText(text); this.OnChange(); this.filterStrategy.OnApplyChanges(withoutCallback); } }, OnButtonClick: function(number){ if(number != this.dropDownButtonIndex){ this.HideDropDownArea(true); } ASPxClientButtonEditBase.prototype.OnButtonClick.call(this, number); }, OnCancelChanges: function(){ var isCancelProcessed = ASPxClientDropDownEditBase.prototype.OnCancelChanges.call(this); this.filterStrategy.OnCancelChanges(); var lb = this.GetListBoxControl(); var index = this.GetAdjustedSelectedIndexByText(lb, this.lastSuccessText); this.SelectIndexSilent(lb, index); return isCancelProcessed; }, OnCloseUp: function(evt){ var evt = _aspxGetEvent(evt); var scrollDiv = this.GetListBoxControl().GetScrollDivElement(); var scrollDivID = scrollDiv ? scrollDiv.id : ""; if(__aspxFirefox && evt.type == "mouseup" && (_aspxGetEventSource(evt).tagName == "DIV" && scrollDivID == _aspxGetEventSource(evt).id)) return; ASPxClientDropDownEditBase.prototype.OnCloseUp.call(this, evt); }, OnDDButtonMouseMove: function(evt){ return (this.droppedDown ? _aspxCancelBubble(evt) : true); }, CloseDropDownByDocumentOrWindowEvent: function(causedByWindowResizing){ this.OnApplyChangesInternal(); ASPxClientDropDownEditBase.prototype.CloseDropDownByDocumentOrWindowEvent.call(this, causedByWindowResizing); }, IsCanToDropDown: function(){ return (this.GetListBoxControl().GetItemCount() > 0); }, OnPopupControlShown: function(){ if(!this.isInitialized) return; if(__aspxOpera) this.GetListBoxControl().RestoreScrollTopFromCache(); if(this.IsScrollSpoilDDShowing()) _aspxSetTimeout("aspxCBMozillaOverflowOn(\"" + this.name + "\")", 100); if(this.lockListBoxClick) delete this.lockListBoxClick; if(this.InCallback()) this.ShowLoadingPanel(); ASPxClientDropDownEditBase.prototype.OnPopupControlShown.call(this); }, OnLBSelectedIndexChanged: function(){ if(!this.lockListBoxClick) { this.OnSelectChanged(); if(this.IsNavigationOnKeyPress()){ if(!this.droppedDown) { _aspxSetSelection(this.GetInputElement()); } } else this.ForceRefocusEditor(); } }, IsNavigationOnKeyPress: function() { var lb = this.GetListBoxControl(); return lb.IsScrollOnKBNavigationLocked(); }, OnListBoxItemMouseUp: function(evt){ if(!this.lockListBoxClick && !this.InCallback()){ this.OnApplyChangesInternal(); this.OnCloseUp(evt); } }, OnMouseWheel: function(evt){ if (this.allowMouseWheel && !this.droppedDown && this.filterStrategy.IsFilterMeetRequirementForMinLength()) { var wheelDelta = _aspxGetWheelDelta(evt); if(wheelDelta > 0) this.SelectNeighbour(-1); else if(wheelDelta < 0) this.SelectNeighbour(1); return _aspxPreventEvent(evt); } }, OnOpenAnotherDropDown: function(){ this.OnApplyChangesAndCloseWithEvents(); }, ParseValue: function() { var newText = this.GetInputElement().value; var oldText = this.GetText(); if(oldText != newText){ if(this.CanTextBeAccepted(newText, oldText)){ this.SetText(newText); this.OnChange(); } else this.SetTextInternal(oldText); } }, CanTextBeAccepted: function(newText, oldText){ var notAnyTextCanBeAccepted = this.isDropDownListStyle; if(notAnyTextCanBeAccepted){ var lb = this.GetListBoxControl(); var newTextPresentInItemCollection = this.GetAdjustedSelectedIndexByText(lb, newText) != -1; return newTextPresentInItemCollection; } return true; }, MakeItemVisible: function(index){ var lb = this.GetListBoxControl(); lb.MakeItemVisible(index); }, PerformCallback: function(arg) { this.isPerformCallback = true; this.filterStrategy.PerformCallback(); this.ClearItemsInternal(); this.GetListBoxControl().PerformCallback(arg); }, ClearItemsInternal: function(){ ASPxClientComboBoxBase.prototype.ClearItemsInternal.call(this); var lbScrollDiv = this.GetListBoxScrollDivElement(); if(lbScrollDiv) lbScrollDiv.scrollTop = "0px"; } }); ASPxClientComboBox.Cast = ASPxClientControl.Cast; ASPxComboBoxDisableFilteringStrategy = _aspxCreateClass(null, { constructor: function(comboBox) { this.comboBox = comboBox; this.isDropDownListStyle = this.comboBox.isDropDownListStyle; this.isApplyAndCloseAfterFiltration = false; }, Initialize: function() {}, AfterDoEndCallback: function() {}, BeforeDoEndCallback: function() {}, IsCallbackResultNotDiscarded: function() { return true; }, IsCloseByEnterLocked: function() { return false; }, OnAfterCallbackFinally: function() { if(this.isApplyAndCloseAfterFiltration){ this.comboBox.OnApplyChangesAndCloseWithEvents(); this.isApplyAndCloseAfterFiltration = false; } }, OnAfterEnter: function() {}, OnApplyChanges: function() {}, OnBeforeCallbackFinally: function() {}, OnBeforeHideDropDownArea: function() {}, OnCallbackInternal: function(result) {}, OnCancelChanges: function () { this.OnFilterRollback(); }, OnDropDownButtonClick: function() {}, OnEscape: function() {}, OnFilteringKeyUp: function (evt) { }, OnFilterRollback: function (withoutCallback) { if (this.comboBox.InCallback() && this.currentCallbackIsFiltration) return; if (this.comboBox.isCallbackMode) { if(!withoutCallback) { this.isApplyAndCloseAfterFiltration = true; if (this.comboBox.GetText() != "" && this.isDropDownListStyle) { this.comboBox.GetListBoxControl().ClearItems(); this.comboBox.SendSpecialCallback(this.GetCurrentSelectedItemCallbackArguments()); } else this.Filtering(); } this.SetFilter(this.comboBox.GetText()); } }, OnSelectionChanged: function() {}, OnSpecialKeyDown: function(evt) {}, OnTab: function() { if(this.comboBox.InCallback()) this.isApplyAndCloseAfterFiltration = true; else this.comboBox.OnApplyChangesAndCloseWithEvents(); }, OnTextChanged: function() {}, PerformCallback: function() {}, GetCallbackArguments: function() { return ""; }, GetInputElement: function() { return this.comboBox.GetInputElement(); }, GetListBoxControl: function() { return this.comboBox.GetListBoxControl(); }, GetCurrentSelectedItemCallbackArguments: function () { return ASPxFilteringUtils.FormatCallbackArg(__aspxtCurrentSelectedItemCallbackPrefix, ""); }, GetStepForClientFiltrationEnabled: function(lb, step) { return step; }, IsFilterMeetRequirementForMinLength: function() { return true; }, IsShowDropDownAllowed: function() { return this.IsFilterMeetRequirementForMinLength(); } }); ASPxComboBoxIncrementalFilteringStrategy = _aspxCreateClass(ASPxComboBoxDisableFilteringStrategy, { constructor: function(comboBox) { this.constructor.prototype.constructor.call(this, comboBox); this.currentCallbackIsFiltration = false; this.refiltrationRequired = false; this.isEnterLocked = false; this.isLastFilteredKeyWasTab = false; this.filter = ""; this.filterInitialized = false; this.filterTimerId = -1; this.filterTimer = comboBox.filterTimer; this.hasInputBeenChanged = false; }, Initialize: function() { var input = this.GetInputElement(); _aspxAttachEventToElement(input, "keyup", aspxCBKeyUp); }, ClearFilter: function() { this.filter = ""; this.filterInitialized = false; }, SetFilter: function(value){ this.filter = value; this.filterInitialized = true; }, FilterCompare: function(value){ if(!this.filterInitialized && this.hasInputBeenChanged) return false; return this.filter == value; }, FilterCompareLower: function(value){ if(!this.filterInitialized) return false; return this.filter.toLowerCase() == value; }, OnCallbackInternal: function(result){ if(!this.currentCallbackIsFiltration) return; var lb = this.GetListBoxControl(); if(lb.GetItemCount() == 0) this.comboBox.HideDropDownArea(true); else this.OnFilterCallbackWithResult(lb); this.isEnterLocked = false; }, OnBeforeCallbackFinally: function() { this.currentCallbackIsFiltration = false; }, OnEndFiltering: function(visibleCollectionChanged) { if(visibleCollectionChanged) this.comboBox.VisibleCollectionChanged(); }, OnFilteringKeyUp: function(evt){ if(this.comboBox.InCallback() || !this.comboBox.GetEnabled()) return; if(ASPxFilteringUtils.EventKeyCodeChangesTheInput(evt)){ this.FilterStopTimer(); var input = this.GetInputElement(); var newFilter = input.value.toLowerCase(); if(evt.keyCode == ASPxKey.Backspace && this.FilterCompareLower(newFilter)) this.FilteringBackspace(); else this.FilterStartTimer(); } }, OnFilterCallbackHighlightAndSelect: function(lb){ var firstItemText = lb.GetItem(0).text; var isTextClearing = !this.isDropDownListStyle && this.FilterCompare("") && !this.FilterCompare(firstItemText); if(!isTextClearing){ var isFilterRollBack = this.CheckForFilterRollback(lb, firstItemText); var isNonFilterChangingCallback = (lb.GetSelectedItem() == null); if(isFilterRollBack || isNonFilterChangingCallback) { if(this.isLastFilteredKeyWasTab){ this.isLastFilteredKeyWasTab = false; this.comboBox.SelectIndex(0); this.comboBox.OnChange(); } else this.HighlightTextAfterCallback(firstItemText); } } }, OnFilterCallbackWithResult: function(lb) { this.OnFilterCallbackHighlightAndSelect(lb); var isNeedToKeepDropDownVisible = !this.comboBox.isPerformCallback && !this.isLastFilteredKeyWasTab; if(isNeedToKeepDropDownVisible) this.EnsureShowDropDownArea(); this.OnEndFiltering(); }, OnSpecialKeyDown: function(evt) { if(ASPxFilteringUtils.EventKeyCodeChangesTheInput(evt)) { this.FilterStopTimer(); this.hasInputBeenChanged = true; } }, AfterDoEndCallback: function() { if(this.refiltrationRequired){ this.refiltrationRequired = false; _aspxSetTimeout("aspxCBFilterByTimer('" + this.comboBox.name + "')", 0); } }, BeforeDoEndCallback: function() { if(this.refiltrationRequired) this.comboBox.preventEndCallbackRising = true; }, GetCallbackArguments: function() { var args = ""; if(!this.FilterCompare("")) args = this.GetCallbackArgumentFilter(this.filter); return args; }, GetCallbackArgumentFilter: function(value){ var callbackPrefix = this.isDropDownListStyle ? __aspxCorrectFilterCallbackPrefix : __aspxLoadFilteredItemsCallbackPrefix; return ASPxFilteringUtils.FormatCallbackArg(callbackPrefix, value); }, PerformCallback: function() { this.ClearFilter(); }, SendFilteringCallback: function(){ this.currentCallbackIsFiltration = true; this.comboBox.SendCallback(); }, IsCallbackResultNotDiscarded: function(){ var result = !this.FilterChanged() || !this.currentCallbackIsFiltration; if(!result) this.refiltrationRequired = true; return result; }, IsFilterTimerActive: function() { return (this.filterTimerId != -1); }, FilterStopTimer: function() { this.filterTimerId = _aspxClearTimer(this.filterTimerId); }, FilterStartTimer: function(){ this.isEnterLocked = true; this.filterTimerId = _aspxSetTimeout("aspxCBFilterByTimer('" + this.comboBox.name + "')", this.filterTimer); }, CheckForFilterRollback: function(lb, firstItemText){ var isHasCorrection = false; var filter = this.filter.toLowerCase(); firstItemText = firstItemText.toLowerCase(); while(!this.IsSatisfy(firstItemText.toLowerCase(), filter)){ filter = filter.slice(0, -1); isHasCorrection = true; } if(isHasCorrection){ this.SetFilter(this.filter.substring(0, filter.length)); this.GetInputElement().value = this.filter; } return isHasCorrection; }, EnsureShowDropDownArea: function(){ if(!this.comboBox.droppedDown && !this.isApplyAndCloseAfterFiltration) this.comboBox.ShowDropDownArea(true); }, FilterChanged: function(){ return !this.FilterCompareLower(this.GetInputElement().value.toLowerCase()); }, FilteringStop: function(){ this.isEnterLocked = false; if(!this.comboBox.isCallbackMode) this.FilteringStopClient(); }, FilteringStopClient: function(){ var lb = this.GetListBoxControl(); var listTable = lb.GetListTable(); var count = lb.GetItemCount(); for(var i = 0; i < count; i ++) _aspxSetElementDisplay(listTable.rows[i], true); this.comboBox.VisibleCollectionChanged(); this.ClearFilter(); }, FilteringBackspace: function(){ var input = this.GetInputElement(); ASPxStartWithFilteringUtils.RollbackOneSuggestedChar(input); this.FilterStartTimer(); }, CheckFilterLength: function() { if(!this.IsFilterMeetRequirementForMinLength()) { this.comboBox.HideDropDownArea(true); var lb = this.GetListBoxControl(); this.isApplyAndCloseAfterFiltration = false; lb.SelectIndexSilent(-1, false); return true; } return false; }, Filtering: function(){ this.FilterStopTimer(); var input = this.GetInputElement(); if(!input) return; var newFilter = input.value; if(!this.FilterCompare(newFilter)){ this.SetFilter(newFilter); if(this.CheckFilterLength()) return; this.EnsureShowDropDownArea(); if(this.comboBox.isCallbackMode) this.FilteringOnServer(); else { this.FilteringOnClient(input); this.isApplyAndCloseAfterFiltration = false; } } else { this.isEnterLocked = false; this.isApplyAndCloseAfterFiltration = false; } }, FilteringOnServer: function(){ if(!this.comboBox.InCallback()){ var listBox = this.GetListBoxControl(); listBox.ClearItems(); listBox.serverIndexOfFirstItem = 0; listBox.SetScrollSpacerVisibility(true, false); listBox.SetScrollSpacerVisibility(false, false); this.SendFilteringCallback(); } }, FilteringOnClient: function (input) { var filter = this.filter.toLowerCase(); var lb = this.GetListBoxControl(); var listTable = lb.GetListTable(); var count = lb.GetItemCount(); var text = ""; var isSatisfy = false; var firstSatisfyItemIndex = -1; if(this.isDropDownListStyle){ var coincide = new Array(count); var maxCoincide = 0; for(var i = count - 1; i >= 0; i--){ coincide[i] = this.GetCoincideCharCount(lb.GetItem(i).text.toLowerCase(), filter); if(coincide[i] > maxCoincide) maxCoincide = coincide[i]; } filter = this.filter.substr(0, maxCoincide); input.value = filter; } for(var i = 0; i < count; i ++){ text = lb.GetItem(i).text; if(this.isDropDownListStyle) isSatisfy = coincide[i] == maxCoincide; else isSatisfy = this.IsSatisfy(text, filter); _aspxSetElementDisplay(listTable.rows[i], isSatisfy); if(firstSatisfyItemIndex == -1 && isSatisfy) { var isTextClearing = !this.isDropDownListStyle && this.FilterCompare("") && this.filter != text; this.OnFirstSatisfiedItemFound(i, text, isTextClearing); firstSatisfyItemIndex = i; } } if(this.isDropDownListStyle) this.SetFilter(filter); var visibleCollectionChanged = firstSatisfyItemIndex != -1; if(visibleCollectionChanged) lb.CopyCellWidths(0, firstSatisfyItemIndex); else this.comboBox.HideDropDownArea(true); this.isEnterLocked = false; this.OnEndFiltering(visibleCollectionChanged); }, GetFirstVisibleItem: function(lb, listTable) { var itemCount = lb.GetItemCount(); for(var i = 0; i < itemCount; i++) if(_aspxGetElementDisplay(listTable.rows[i])) return i; return -1; }, GetVisibleItemsCount: function() { var lb = this.GetListBoxControl(); var listTable = lb.GetListTable(); var itemCount = lb.GetItemCount(); var visibleItemCount = 0; for(var i = 0; i < itemCount; i++) if(_aspxGetElementDisplay(listTable.rows[i])) visibleItemCount++; return visibleItemCount; }, IsSelectedElementVisible: function(listTable, selectedIndex) { return _aspxGetElementDisplay(listTable.rows[selectedIndex]); }, GetStepForClientFiltrationEnabled: function(lb, step) { if(this.comboBox.isCallbackMode) return step; var listTable = lb.GetListTable(); var startIndex = this.comboBox.GetSelectedIndex(); var firstVisibleElementIndex = this.GetFirstVisibleItem(lb, listTable); if(startIndex > -1) { if(!this.IsSelectedElementVisible(listTable, startIndex)) return firstVisibleElementIndex - startIndex; } else return firstVisibleElementIndex + 1; var stepDirection = step > 0 ? 1 : -1; var count = lb.GetItemCount(); var needVisibleItemCount = Math.abs(step); var outermostVisibleIndex = startIndex; for(var index = startIndex + stepDirection; needVisibleItemCount > 0; index += stepDirection){ if(index < 0 || count <= index) break; if(_aspxGetElementDisplay(listTable.rows[index])) { outermostVisibleIndex = index; needVisibleItemCount--; } } step = outermostVisibleIndex - this.comboBox.GetSelectedIndex(); return step; }, GetCoincideCharCount: function(text, filter) { while(filter != "" && !this.IsSatisfy(text, filter)) { filter = filter.slice(0, -1); } return filter.length; }, OnSelectionChanged: function() { }, IsFilterMeetRequirementForMinLength: function() { var inputElement = this.GetInputElement(); var isFilterExists = inputElement && (inputElement.value || inputElement.value == ""); return isFilterExists ? inputElement.value.length >= this.comboBox.filterMinLength : true; }, IsSatisfy: function(text, filter) {}, OnFirstSatisfiedItemFound: function(index, text, isTextClearing) {}, HighlightTextAfterCallback: function() {} }); ASPxContainsFilteringStrategy = _aspxCreateClass(ASPxComboBoxIncrementalFilteringStrategy, { constructor: function(comboBox) { this.constructor.prototype.constructor.call(this, comboBox); }, IsSatisfy: function(text, filter) { return text.toLowerCase().indexOf(filter) != -1; }, IsCloseByEnterLocked: function() { if(this.isDropDownListStyle) { if(this.GetVisibleItemsCount() == 1) return false; var selectedItem = this.comboBox.GetSelectedItem(); if(selectedItem) if(this.GetInputElement().value == selectedItem.text) return false; return true; } return false; }, FilteringOnClient: function(input) { this.UnselectContainsTextInItems(); ASPxComboBoxIncrementalFilteringStrategy.prototype.FilteringOnClient.call(this, input); }, OnApplyChanges: function (withoutCallback) { this.OnFilterRollback(withoutCallback); }, OnBeforeCallbackFinally: function() { ASPxComboBoxIncrementalFilteringStrategy.prototype.OnBeforeCallbackFinally.call(this); this.ReselectContainsTextInItems(); this.SetDefautSelection(); }, OnDropDownButtonClick: function() { if(this.GetVisibleItemsCount() == 0 && this.isDropDownListStyle) this.comboBox.OnCancelChanges(); }, OnTextChanged: function() { if(!this.comboBox.IsFocusEventsLocked()) if(!this.comboBox.ChangedByEnterKeyPress()) this.OnFilterRollback(); }, OnEndFiltering: function(visibleCollectionChanged) { this.SelectContainsTextInItems(); this.SetDefautSelection(); ASPxComboBoxIncrementalFilteringStrategy.prototype.OnEndFiltering.call(this, visibleCollectionChanged); }, OnBeforeHideDropDownArea: function(){ if(!this.comboBox.isCallbackMode) this.FilteringStopClient(); }, FilteringStopClient: function(){ ASPxComboBoxIncrementalFilteringStrategy.prototype.FilteringStopClient.call(this); this.UnselectContainsTextInItems(); }, OnCallbackInternal: function() { if(!this.comboBox.isPerformCallback) this.ReselectContainsTextInItems(); ASPxComboBoxIncrementalFilteringStrategy.prototype.OnCallbackInternal.call(this); }, OnFirstSatisfiedItemFound: function() { }, SetDefautSelection: function() { var visibleItemsCount = this.GetVisibleItemsCount(); if(this.isDropDownListStyle && visibleItemsCount == 1) { var lb = this.GetListBoxControl(); var listTable = lb.GetListTable(); this.comboBox.SelectIndexSilent(lb, this.GetFirstVisibleItem(lb,listTable)); } }, UnselectContainsTextInItems: function() { this.ApplySelectionFunctionToItems(ASPxContainsFilteringUtils.UnselectContainsTextInElement, true); }, ReselectContainsTextInItems: function() { if(this.filter != "") this.ApplySelectionFunctionToItems(ASPxContainsFilteringUtils.ReselectContainsTextInElement, false); }, SelectContainsTextInItems: function() { if(this.filter != "") this.ApplySelectionFunctionToItems(ASPxContainsFilteringUtils.SelectContainsTextInElement, false); }, ApplySelectionFunctionToItems: function(selectionFunction, applyToAllColumns) { var lb = this.GetListBoxControl(); var count = lb.GetItemCount(); for(var i = 0; i < count; i ++) { var item = lb.GetItemRow(i); if(applyToAllColumns || (!applyToAllColumns && _aspxGetElementDisplay(item))) this.ApplySelectionFunctionToItem(item, selectionFunction, applyToAllColumns); } }, ApplySelectionFunctionToItem: function(item, selectionFunction, applyToAllColumns) { var itemValues = this.GetItemValuesByItem(item); var itemSelection = ASPxContainsFilteringUtils.GetColumnSelectionsForItem(itemValues, this.GetListBoxControl().textFormatString, this.filter); if(applyToAllColumns) { for(var i = 0; i < item.cells.length; i++) selectionFunction(item.cells[i], itemSelection[i]); } else { for(var i = 0; i < itemSelection.length; i++) selectionFunction(item.cells[itemSelection[i].index], itemSelection[i]); } }, GetItemValuesByItem: function(item) { var result = []; for(var i = 0; i < item.cells.length; i++) result.push( _aspxGetInnerText(item.cells[i])); return result; } }); ASPxFilteringUtils = { EventKeyCodeChangesTheInput: function(evt){ if(_aspxIsPasteShortcut(evt)) return true; else if(evt.ctrlKey) return false; var keyCode = _aspxGetKeyCode(evt); var isSystemKey = ASPxKey.Windows <= keyCode && keyCode <= ASPxKey.ContextMenu; var isFKey = ASPxKey.F1 <= keyCode && keyCode <= 127; return ASPxKey.Delete <= keyCode && !isSystemKey && !isFKey || keyCode == ASPxKey.Backspace || keyCode == ASPxKey.Space; }, FormatCallbackArg: function(prefix, arg) { return (_aspxIsExists(arg) ? prefix + "|" + arg.length + ';' + arg + ';' : ""); } }; ASPxFormatStringHelper = { PlaceHolderTemplateStruct: function(startIndex, length, index, placeHolderString){ this.startIndex = startIndex; this.realStartIndex = 0; this.length = length; this.realLength = 0; this.index = index; this.placeHolderString = placeHolderString; }, GetPlaceHolderTemplates: function(formatString){ formatString = this.CollapseDoubleBrackets(formatString); var templates = this.CreatePlaceHolderTemplates(formatString); return templates; }, CreatePlaceHolderTemplates: function(formatString){ var templates = []; var templateStrings = formatString.match(/{[^}]+}/g); if(templateStrings != null){ var pos = 0; for(var i = 0; i < templateStrings.length; i++){ var tempString = templateStrings[i]; var startIndex = formatString.indexOf(tempString, pos); var length = tempString.length; var indexString = tempString.slice(1).match(/^[0-9]+/); var index = parseInt(indexString); templates.push(new this.PlaceHolderTemplateStruct(startIndex, length, index, tempString)); pos = startIndex + length; } } return templates; }, CollapseDoubleBrackets: function(formatString){ formatString = this.CollapseOpenDoubleBrackets(formatString); formatString = this.CollapseCloseDoubleBrackets(formatString); return formatString; }, CollapseOpenDoubleBrackets: function(formatString){ return formatString.replace(/{{/g, "_"); }, CollapseCloseDoubleBrackets: function(formatString){ while(true){ var index = formatString.lastIndexOf("}}"); if(index == -1) break; else formatString = formatString.substr(0, index) + "_" + formatString.substr(index + 2); } return formatString; } }; ASPxStartWithFilteringUtils = { HighlightSuggestedText: function(input, suggestedText){ var currentTextLenght = input.value.length; var suggestedTextLenght = suggestedText.length; input.value = suggestedText; if(currentTextLenght < suggestedTextLenght) _aspxSetInputSelection(input, currentTextLenght, suggestedTextLenght); }, RollbackOneSuggestedChar: function(input){ var currentText = input.value; var cutText = currentText.slice(0, -1); if(cutText != currentText) input.value = cutText; } }; ASPxContainsFilteringUtils = { ColumnSelectionStruct: function(index, startIndex, length){ this.index = index; this.length = length; this.startIndex = startIndex; }, IsFilterCrossPlaseHolder: function(filterStartIndex, filterEndIndex, template) { var left = Math.max(filterStartIndex, template.realStartIndex); var right = Math.min(filterEndIndex, template.realStartIndex + template.realLength); return left < right; }, GetColumnSelectionsForItem: function(itemValues, formatString, filterString) { if(formatString == "") return this.GetSelectionForSingleColumnItem(itemValues, filterString); var result = []; var formatedString = ASPxFormatter.Format(formatString, itemValues); var filterStartIndex = formatedString.toLowerCase().indexOf(filterString.toLowerCase()); if(filterStartIndex == -1) return result; var filterEndIndex = filterStartIndex + filterString.length; var templates = ASPxFormatStringHelper.GetPlaceHolderTemplates(formatString); this.SupplyTemplatesWithRealValues(itemValues, templates); for(var i = 0; i < templates.length ; i++) { if(this.IsFilterCrossPlaseHolder(filterStartIndex, filterEndIndex, templates[i])) result.push(this.GetColumnSelectionsForItemValue(templates[i], filterStartIndex, filterEndIndex)); } return result; }, GetColumnSelectionsForItemValue: function(template, filterStartIndex, filterEndIndex) { var selectedTextStartIndex = filterStartIndex < template.realStartIndex ? 0 : filterStartIndex - template.realStartIndex; var selectedTextEndIndex = filterEndIndex > template.realStartIndex + template.realLength ? template.realLength : filterEndIndex - template.realStartIndex; var selectedTextLength = selectedTextEndIndex - selectedTextStartIndex; return new this.ColumnSelectionStruct(template.index, selectedTextStartIndex, selectedTextLength); }, GetSelectionForSingleColumnItem: function(itemValues, filterString) { var selectedTextStartIndex = itemValues[0].toLowerCase().indexOf(filterString.toLowerCase()); var selectedTextLength = filterString.length; return [new this.ColumnSelectionStruct(0, selectedTextStartIndex, selectedTextLength)]; }, ResetFormatStringIndex: function(formatString, index) { if(index != 0) return formatString.replace(index.toString(), "0"); return formatString; }, SupplyTemplatesWithRealValues: function(itemValues, templates) { var shift = 0; for(var i = 0; i < templates.length; i++) { var formatString = this.ResetFormatStringIndex(templates[i].placeHolderString, templates[i].index); var currentItemValue = itemValues[templates[i].index]; templates[i].realLength = ASPxFormatter.Format(formatString, currentItemValue).length; templates[i].realStartIndex += templates[i].startIndex + shift; shift += templates[i].realLength - templates[i].placeHolderString.length; } }, PrepareElementText: function(itemText) { return itemText ? itemText.replace(/\&/g, "&").replace(//g, ">") : ''; }, UnselectContainsTextInElement: function(element, selection) { var currentText = _aspxGetAttribute(element, "DXText"); if (_aspxIsExists(currentText)) { currentText = ASPxContainsFilteringUtils.PrepareElementText(currentText); _aspxSetInnerHtml(element, currentText === "" ? " " : currentText); } }, ReselectContainsTextInElement: function(element, selection) { var currentText = _aspxGetInnerText(element); if(currentText.indexOf("") != -1) ASPxContainsFilteringUtils.UnselectContainsTextInElement(element, selection); return ASPxContainsFilteringUtils.SelectContainsTextInElement(element, selection); }, SelectContainsTextInElement: function(element, selection) { if(selection.startIndex == -1) return; var currentText = _aspxGetAttribute(element, "DXText"); if (!_aspxIsExists(currentText)) _aspxSetAttribute(element, "DXText", _aspxGetInnerText(element)); var oldInnerText = _aspxGetInnerText(element); var newInnerText = ASPxContainsFilteringUtils.PrepareElementText(oldInnerText.substr(0, selection.startIndex)) + "" + oldInnerText.substr(selection.startIndex, selection.length) + "" + ASPxContainsFilteringUtils.PrepareElementText(oldInnerText.substr(selection.startIndex + selection.length)); _aspxSetInnerHtml(element, newInnerText); } }; ASPxStartsWithFilteringStrategy = _aspxCreateClass(ASPxComboBoxIncrementalFilteringStrategy, { constructor: function(comboBox) { this.constructor.prototype.constructor.call(this, comboBox); }, IsSatisfy: function(text, filter) { return text.toLowerCase().indexOf(filter) == 0; }, FilteringHighlightCompletedText: function(filterItemText){ var input = this.GetInputElement(); ASPxStartWithFilteringUtils.HighlightSuggestedText(input, filterItemText); }, HighlightTextAfterCallback: function(firstItemText) { var lb = this.GetListBoxControl(); this.FilteringHighlightCompletedText(firstItemText); if(!this.comboBox.isPerformCallback ) this.comboBox.SelectIndexSilent(lb, 0); }, OnAfterEnter: function() { this.ClearInputSelection(); }, OnBeforeHideDropDownArea: function() { this.FilteringStop(); }, OnFirstSatisfiedItemFound: function(index, text, isTextClearing) { var lb = this.GetListBoxControl(); if(!isTextClearing) this.FilteringHighlightCompletedText(text); this.comboBox.SelectIndexSilent(lb, isTextClearing ? -1 : index); }, OnTab: function() { if(this.IsFilterTimerActive() || this.currentCallbackIsFiltration){ this.isLastFilteredKeyWasTab = true; this.Filtering(); } ASPxComboBoxDisableFilteringStrategy.prototype.OnTab.call(this); }, ClearInputSelection: function() { var inputElement = this.comboBox.GetInputElement(); _aspxClearInputSelection(inputElement); } }); ASPxClientNativeComboBox = _aspxCreateClass(ASPxClientComboBoxBase, { constructor: function(name) { this.constructor.prototype.constructor.call(this, name); this.initSelectedIndex = -1; this.raiseValueChangedOnEnter = false; }, Initialize: function(){ var lb = this.GetListBoxControl(); if(lb != null) lb.SetMainElement(this.GetMainElement()); ASPxClientComboBoxBase.prototype.Initialize.call(this); }, InitLastSuccessText: function(){ this.SelectIndex(this.initSelectedIndex, true); }, FindInputElement: function(){ return this.GetMainElement(); }, GetDropDownInnerControlName: function(suffix){ return this.name + suffix; }, PerformCallback: function(arg) { this.GetListBoxControl().PerformCallback(arg); }, GetTextInternal: function(){ var selectedItem = this.GetSelectedItem(); return (selectedItem != null) ? selectedItem.text : ""; }, HasTextDecorators: function() { return false; }, SetText: function (text){ var lb = this.GetListBoxControl(); var index = this.FindItemIndexByText(lb, text); this.SelectIndex(index, false); this.SetLastSuccessTest((index > -1) ? text : ""); this.SetLastSuccessValue((index > -1) ? lb.GetValue() : null); }, GetValue: function(){ var selectedItem = this.GetSelectedItem(); return (selectedItem != null) ? selectedItem.value : null; }, SetValue: function(value){ var lb = this.GetListBoxControl(); if(lb){ lb.SetValue(value); var item = lb.GetSelectedItem(); var text = item ? item.text : value; this.SetLastSuccessTest((item != null) ? text : ""); this.SetLastSuccessValue(item != null) ? item.value : null; } }, ForceRefocusEditor: function(){ }, OnCallback: function(result) { this.GetListBoxControl().OnCallback(result); if(this.GetItemCount() > 0) this.SetSelectedIndex(0); }, OnTextChanged: function() { this.OnChange(); }, SetTextInternal: function(text){ }, SetTextBase: function(text){ }, ChangeEnabledAttributes: function(enabled){ this.GetMainElement().disabled = !enabled; } }); var __aspxDropDownCollection = null; function aspxGetDropDownCollection(){ if(__aspxDropDownCollection == null) __aspxDropDownCollection = new ASPxClientDropDownCollection(); return __aspxDropDownCollection; } _aspxAttachEventToDocument(ASPxClientTouchUI.touchMouseDownEventName, aspxDropDownDocumentMouseDown); function aspxDropDownDocumentMouseDown(evt){ return aspxGetDropDownCollection().OnDocumentMouseDown(evt); } _aspxAttachEventToDocument("mouseup", aspxDropDownDocumentMouseUp); function aspxDropDownDocumentMouseUp(evt){ return aspxGetDropDownCollection().OnDocumentMouseUp(evt); } function aspxDDDropDown(name, evt){ if(_aspxGetIsLeftButtonPressed(evt)){ var dd = aspxGetControlCollection().Get(name); if(dd) return dd.OnDropDown(evt); } } function aspxDDCloseUp(name, evt){ var dd = aspxGetControlCollection().Get(name); if(dd) dd.OnCloseUp(evt); } function aspxDDRefocusClick(name, evt) { var dd = aspxGetControlCollection().Get(name); if (dd && dd.GetInputElement() && _aspxGetEventSource(evt).id != dd.GetInputElement().id) dd.ForceRefocusEditor(evt); } function aspxDDBPCShown(name){ var cb = aspxGetControlCollection().Get(name); if(cb != null) cb.OnPopupControlShown(); } function aspxDDBRaiseDropDownByTimer(name){ var cb = aspxGetControlCollection().Get(name); if(cb != null) cb.RaiseDropDown(); } function aspxCBLBSelectedIndexChanged(name, evt){ var cb = aspxGetControlCollection().Get(name); if(cb != null) cb.OnLBSelectedIndexChanged(); } function aspxCBLBItemMouseUp(name, evt){ var cb = aspxGetControlCollection().Get(name); if(cb != null) cb.OnListBoxItemMouseUp(evt); } function aspxCBMozillaOverflowOn(name){ var cb = aspxGetControlCollection().Get(name); cb.EnableLBDivOverflow(); } function aspxCBDDButtonMMove(evt){ return aspxGetDropDownCollection().OnDDButtonMouseMove(evt); } function aspxCBMouseWheel(evt){ var srcElement = _aspxGetEventSource(evt); var focusedCB = aspxGetDropDownCollection().GetFocusedDropDown(); if(focusedCB != null && _aspxGetIsParent(focusedCB.GetMainElement(), srcElement)) return focusedCB.OnMouseWheel(evt); } function aspxCBKeyUp(evt){ var cb = aspxGetDropDownCollection().GetFocusedDropDown(); if (cb != null) cb.filterStrategy.OnFilteringKeyUp(evt); } function aspxCBFilterByTimer(name){ var cb = aspxGetControlCollection().Get(name); if(cb != null) cb.filterStrategy.Filtering(); } } /* playback timings (ms): esindex: 0.011 exclusion.robots.policy: 0.353 captures_list: 278.796 exclusion.robots: 0.366 PetaboxLoader3.datanode: 274.471 (4) load_resource: 91.083 RedisCDXSource: 12.089 CDXLines.iter: 19.447 (3) PetaboxLoader3.resolve: 41.638 LoadShardBlock: 243.394 (3) */