")}},appendCommandHtml:function(g,h){if(g){var e=this.localization;var f=function(i,j){j.cat('")};d.each(g,function(){var j=h.cat('");var i=this.buttonType;if(i=="Image"){f(this,j)}else{if(i=="ImageAndText"){f(this,j);j.cat(e[this.name])}else{j.cat(e[this.name])}}j.cat("")})}},normalizeColumns:function(){},dataItem:function(e){return this.data[this.$tbody.find("> tr:not(.t-grouping-row,.t-detail-row)").index(d(e))]},bindTo:function(j){var g=new a.stringBuilder();if(j&&j.length){var h=this.groups.length+this.columns.length+(this.detail?1:0);this.normalizeColumns(h);if("HasSubgroups" in j[0]){for(var e=0,f=j.length;e=e).removeClass("t-state-hover");this.$pager.find(".t-arrow-prev").parent().add(this.$pager.find(".t-arrow-first").parent()).toggleClass("t-state-disabled",g==1).removeClass("t-state-hover");var f=this.localization;this.$pager.find(".t-page-i-of-n").each(function(){this.innerHTML=new a.stringBuilder().cat(f.page).cat(' ').cat(a.formatString(f.pageOf,e)).string()});this.$pager.find(".t-numeric").each(d.proxy(function(i,h){this.numericPager(h,g,e)},this));this.$pager.parent().find(".t-status-text").text(a.formatString(f.displayingItems,this.firstItemInPage(),this.lastItemInPage(),this.total))},numericPager:function(f,l,m){var j=10;var h=1;if(l>j){var e=(l%j);h=(e==0)?(l-j)+1:(l-e)+1}var i=(h+j)-1;i=Math.min(i,m);var g=new a.stringBuilder();if(h>1){g.cat('...')}for(var k=h;k<=i;k++){if(k==l){g.cat('').cat(k).cat("")}else{g.cat('').cat(k).cat("")}}if(i...')}f.innerHTML=g.string()},$columns:function(){return this.$header.find("th:not(.t-hierarchy-cell,.t-group-cell)")},updateSorting:function(){this.sorted=[];d.each(this.orderBy.split("~"),d.proxy(function(f,e){var g=e.split("-");var h=this.columnFromMember(g[0]);if(h){h.order=g[1];this.sorted.push(h)}},this));this.$columns().each(d.proxy(function(f,j){var g=this.columns[f].order;var e=d(j).children(".t-link");var h=e.children(".t-icon");if(!g){h.hide()}else{if(h.length==0){h=d('').appendTo(e)}h.toggleClass("t-arrow-up",g=="asc").toggleClass("t-arrow-down",g=="desc").show()}},this))},sanitizePage:function(f){var e=parseInt(f,10);if(isNaN(e)||e<1){return 1}return Math.min(e,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(e){this.data=[];this.bindTo(e);this.updatePager();this.updateSorting();a.trigger(this.element,"dataBound")},rebind:function(f){this.sorted=[];this.filterBy="";this.currentPage=1;d.each(this.columns,function(){this.order=null;this.filters=[]});d(".t-filter-options",this.element).find('input[type="text"], select').val("").removeClass("t-state-error");for(var h in f){var g=new RegExp(a.formatString("({0})=([^&]*)",h),"g");if(g.test(this.ajax.selectUrl)){this.ajax.selectUrl=this.ajax.selectUrl.replace(g,"$1="+f[h])}else{var e=new a.stringBuilder();e.cat(this.ajax.selectUrl);if(this.ajax.selectUrl.indexOf("?")<0){e.cat("?")}else{e.cat("&")}this.ajax.selectUrl=e.cat(h).cat("=").cat(f[h]).string()}}this.ajaxRequest()}};d.fn.tGrid=function(e){return a.create(this,{name:"tGrid",init:function(f,g){return new a.grid(f,g)},options:e,success:function(f){if(f.$tbody.find("tr.t-no-data").length){f.ajaxRequest()}}})};d.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",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);