/* * Kendo UI v2011.3.1129 (http://kendoui.com) * Copyright 2011 Telerik AD. All rights reserved. * * Kendo UI commercial licenses may be obtained at http://kendoui.com/license. * If you do not own a commercial license, this file shall be governed by the * GNU General Public License (GPL) version 3. For GPL requirements, please * review: http://www.gnu.org/copyleft/gpl.html */ (function(a,b){var c=window.kendo,d=c.ui,e=d.Select,f="disabled",g="change",h="select",i="k-state-focused",j="k-state-default",k="k-state-disabled",l="k-state-selected",m="k-state-hover",n="mouseenter mouseleave",o=".k-dropdown-wrap",p=a.proxy,q=e.extend({init:function(b,c){var d=this,c=a.isArray(c)?{dataSource:c}:c;e.fn.init.call(d,b,c),c=d.options,b=d.element.focus(function(){d.wrapper.focus()}),d._reset(),d._word="",d._wrapper(),d._span(),d._popup(),d._accessors(),d._dataSource(),d._enable(),d.bind([g],c),c.autoBind?d.dataSource.fetch():b.is(h)&&d.text(b.children(":selected").text())},options:{name:"DropDownList",enable:!0,index:0,autoBind:!0,delay:500,dataTextField:"text",dataValueField:"value",height:200},enable:function(a){var b=this,c=b.element,d=b.wrapper,e=b._inputWrapper;a===!1?(c.attr(f,f),d.unbind(),e.removeClass(j).addClass(k).unbind(n)):(c.removeAttr(f,f),e.addClass(j).removeClass(k).bind(n,b._toggleHover),d.bind({keydown:p(b._keydown,b),keypress:p(b._keypress,b),focusin:function(){b._inputWrapper.addClass(i),clearTimeout(b._bluring)},click:function(){b.toggle()},focusout:function(a){b._bluring=setTimeout(function(){b._blur(),b._inputWrapper.removeClass(i)},100)}}))},open:function(){var a=this,b=a._current;a.ul[0].firstChild?(a.popup.open(),b&&a._scroll(b[0])):(a._open=!0,a.dataSource.fetch())},toggle:function(a){this._toggle(a)},refresh:function(){var a=this,b=a.value(),d=a.options,e=a._data(),f=e.length;a.ul[0].innerHTML=c.render(a.template,e),a._height(f),a.element.is(h)&&a._options(e),b?a.value(b):a.select(d.index),a._old=a.value(),a._open&&a.toggle(f),a._hideBusy()},search:function(a){if(a){var c=this;a=a.toLowerCase(),c.select(function(d){var e=c._text(d);if(e!==b)return(e+"").toLowerCase().indexOf(a)===0})}},select:function(a){var c=this,e=c.element[0],f=c._current,g=c._data(),h,i,j;a=c._get(a),a&&a[0]&&!a.hasClass(l)&&(f&&f.removeClass(l),j=d.List.inArray(a[0],c.ul[0]),j>-1&&(g=g[j],i=c._text(g),h=c._value(g),c.text(i),c._accessor(h!=b?h:i,j),c.current(a.addClass(l))))},text:function(a){var c=this.span;if(a!==b)c.text(a);else return c.text()},value:function(a){var c=this,d,e=c.element;if(a!==b)d=c._index(a),c.select(d>-1?d:0),c._old=c._accessor();else return c._accessor()},_accept:function(a){this._focus(a)},_data:function(){var a=this,b=a.options,c=b.optionLabel,d=b.dataTextField,e=b.dataValueField,f=a.dataSource.view(),g=f.length,h=c,i=0;if(c&&g){d&&(h={},h[d]=c,e&&(h[e]="")),h=[h];for(;i select').append(b.element),e=c.find(d)),b.span=e,b._arrow=c.find(".k-icon"),b._inputWrapper=a(c[0].firstChild)},_wrapper:function(){var a=this,b=a.element,c=b[0],d="tabIndex",e;e=b.parent(),e.is("span.k-widget")||(e=b.wrap("").parent()),e.attr(d)||e.attr(d,0),e[0].style.cssText=c.style.cssText,b.hide(),a._focused=a.wrapper=e.addClass("k-widget k-dropdown k-header").addClass(c.className)}});d.plugin(q)})(jQuery)