kendo.columnsorter.min.js 5.95 KB
/** 
 * Kendo UI v2016.1.112 (http://www.telerik.com/kendo-ui)                                                                                                                                               
 * Copyright 2016 Telerik AD. All rights reserved.                                                                                                                                                      
 *                                                                                                                                                                                                      
 * Kendo UI commercial licenses may be obtained at                                                                                                                                                      
 * http://www.telerik.com/purchase/license-agreement/kendo-ui-complete                                                                                                                                  
 * If you do not own a commercial license, this file shall be governed by the trial license terms.                                                                                                      
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       

*/
!function(e,define){define("kendo.columnsorter.min",["kendo.core.min"],e)}(function(){return function(e,n){var r=window.kendo,t=r.ui,o=t.Widget,i="dir",a="asc",l="single",d="field",s="desc",c=".kendoColumnSorter",f=".k-link",u="aria-sort",k=e.proxy,m=o.extend({init:function(e,n){var r,t=this;o.fn.init.call(t,e,n),t._refreshHandler=k(t.refresh,t),t.dataSource=t.options.dataSource.bind("change",t._refreshHandler),r=t.element.find(f),r[0]||(r=t.element.wrapInner('<a class="k-link" href="#"/>').find(f)),t.link=r,t.element.on("click"+c,k(t._click,t))},options:{name:"ColumnSorter",mode:l,allowUnsort:!0,compare:null,filter:""},destroy:function(){var e=this;o.fn.destroy.call(e),e.element.off(c),e.dataSource.unbind("change",e._refreshHandler),e._refreshHandler=e.element=e.link=e.dataSource=null},refresh:function(){var n,t,o,l,c=this,f=c.dataSource.sort()||[],k=c.element,m=k.attr(r.attr(d));for(k.removeAttr(r.attr(i)),k.removeAttr(u),n=0,t=f.length;t>n;n++)o=f[n],m==o.field&&k.attr(r.attr(i),o.dir);l=k.attr(r.attr(i)),k.find(".k-i-arrow-n,.k-i-arrow-s").remove(),l===a?(e('<span class="k-icon k-i-arrow-n" />').appendTo(c.link),k.attr(u,"ascending")):l===s&&(e('<span class="k-icon k-i-arrow-s" />').appendTo(c.link),k.attr(u,"descending"))},_click:function(e){var t,o,c=this,f=c.element,u=f.attr(r.attr(d)),k=f.attr(r.attr(i)),m=c.options,p=null===c.options.compare?n:c.options.compare,h=c.dataSource.sort()||[];if(e.preventDefault(),!m.filter||f.is(m.filter)){if(k=k===a?s:k===s&&m.allowUnsort?n:a,m.mode===l)h=[{field:u,dir:k,compare:p}];else if("multiple"===m.mode){for(t=0,o=h.length;o>t;t++)if(h[t].field===u){h.splice(t,1);break}h.push({field:u,dir:k,compare:p})}this.dataSource.sort(h)}}});t.plugin(m)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,n,r){(r||n)()});
//# sourceMappingURL=kendo.columnsorter.min.js.map