")}this.$tbody.html(h.string());if(this.onRowDataBound){var m=jQuery.grep(this.$tbody[0].rows,function(i){return !e(i).hasClass("t-grouping-row")});for(var f=0,g=this.data.length;f=f).removeClass("t-state-hover");this.$pager.find(".t-arrow-prev").parent().add(this.$pager.find(".t-arrow-first").parent()).toggleClass("t-state-disabled",h==1).removeClass("t-state-hover");var g=this.localization;this.$pager.find(".t-page-i-of-n").each(function(){this.innerHTML=new b.stringBuilder().cat(g.page).cat(' ').cat(b.formatString(g.pageOf,f)).string()});this.$pager.find(".t-numeric").each(e.proxy(function(j,i){this.numericPager(i,h,f)},this));this.$pager.parent().find(".t-status-text").text(b.formatString(g.displayingItems,this.firstItemInPage(),this.lastItemInPage(),this.total))},numericPager:function(g,m,n){var k=10;var i=1;if(m>k){var f=(m%k);i=(f==0)?(m-k)+1:(m-f)+1}var j=(i+k)-1;j=Math.min(j,n);var h=new b.stringBuilder();if(i>1){h.cat('...')}for(var l=i;l<=j;l++){if(l==m){h.cat('').cat(l).cat("")}else{h.cat('').cat(l).cat("")}}if(j...')}g.innerHTML=h.string()},$columns:function(){return this.$header.find("th:not(.t-hierarchy-cell,.t-group-cell)")},updateSorting:function(){this.sorted=[];e.each(this.orderBy.split("~"),e.proxy(function(g,f){var h=f.split("-");var i=this.columnFromMember(h[0]);if(i){i.order=h[1];this.sorted.push(i)}},this));this.$columns().each(e.proxy(function(g,k){var h=this.columns[g].order;var f=e(k).children(".t-link");var j=f.children(".t-icon");if(!h){j.hide()}else{if(j.length==0){j=e('').appendTo(f)}j.toggleClass("t-arrow-up",h=="asc").toggleClass("t-arrow-down",h=="desc").show()}},this))},sanitizePage:function(g){var f=parseInt(g,10);if(isNaN(f)||f<1){return this.currentPage}return Math.min(f,this.totalPages())},totalPages:function(){return Math.ceil(this.total/this.pageSize)},firstItemInPage:function(){return this.total>0?(this.currentPage-1)*this.pageSize+1:0},lastItemInPage:function(){return Math.min(this.currentPage*this.pageSize,this.total)},dataBind:function(f){this.data=[];this.bindTo(f);this.updatePager();this.updateSorting();b.trigger(this.element,"dataBound")},rebind:function(g){this.sorted=[];this.filterBy="";this.currentPage=1;e.each(this.columns,function(){this.order=null;this.filters=[]});e(".t-filter-options",this.element).find('input[type="text"], select').val("").removeClass("t-state-error");for(var i in g){var h=new RegExp(b.formatString("({0})=([^&]*)",i),"g");if(h.test(this.ajax.selectUrl)){this.ajax.selectUrl=this.ajax.selectUrl.replace(h,"$1="+g[i])}else{var f=new b.stringBuilder();f.cat(this.ajax.selectUrl);if(this.ajax.selectUrl.indexOf("?")<0){f.cat("?")}else{f.cat("&")}this.ajax.selectUrl=f.cat(i).cat("=").cat(g[i]).string()}}this.ajaxRequest()}};e.fn.tGrid=function(f){return b.create(this,{name:"tGrid",init:function(g,h){return new b.grid(g,h)},options:f,success:function(g){if(g.$tbody.find("tr.t-no-data").length){g.ajaxRequest()}}})};e.fn.tGrid.defaults={columns:[],plugins:[],currentPage:1,pageSize:10,localization:{addNew:"Add new record","delete":"Delete",cancel:"Cancel",insert:"Insert",update:"Update",select:"Select",pageOf:"of {0}",displayingItems:"Displaying items {0} - {1} of {2}",edit:"Edit",noRecords:"No records to display.",page:"Page ",filter:"Filter",filterClear:"Clear Filter",filterShowRows:"Show rows with value that",filterAnd:"And",filterStringEq:"Is equal to",filterStringNe:"Is not equal to",filterStringStartsWith:"Starts with",filterStringSubstringOf:"Contains",filterStringEndsWith:"Ends with",filterNumberEq:"Is equal to",filterNumberNe:"Is not equal to",filterNumberLt:"Is less than",filterNumberLe:"Is less than or equal to",filterNumberGt:"Is greater than",filterNumberGe:"Is greater than or equal to",filterDateEq:"Is equal to",filterDateNe:"Is not equal to",filterDateLt:"Is before",filterDateLe:"Is before or equal to",filterDateGt:"Is after",filterDateGe:"Is after or equal to",filterEnumEq:"Is equal to",filterEnumNe:"Is not equal to",filterBoolIsTrue:"is true",filterBoolIsFalse:"is false",filterSelectValue:"-Select value-",filterOpenPopupHint:"Open the calendar popup",groupHint:"Drag a column header and drop it here to group by that column",deleteConfirmation:"Are you sure you want to delete this record?"},queryString:{page:"page",size:"size",orderBy:"orderBy",groupBy:"groupBy",filter:"filter"}}})(jQuery);