You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

0 lines
38 KiB

2 years ago
  1. (function(n,t,i){function e(n,i){var u=t(n);u.data(o,this);this._container=u;this.data=[];this.total=0;this.fields=[];this._editingRow=null;this._sortField=null;this._sortOrder=r;this._firstDisplayingPage=1;this._init(i);this.render()}var o="JSGrid",f="JSGridItem",s="JSGridEditRow",r="asc",v="desc",y="{first}",p="{pages}",w="{prev}",b="{next}",k="{last}",d="{pageIndex}",g="{pageCount}",nt="{itemCount}",tt="javascript:void(0);",u=function(n,i){return t.isFunction(n)?n.apply(i,t.makeArray(arguments).slice(2)):n},it=function(n){var i=t.Deferred();return n&&n.then?n.then(function(){i.resolve.apply(i,arguments)},function(){i.reject.apply(i,arguments)}):i.resolve(n),i.promise()},h={loadData:t.noop,insertItem:t.noop,updateItem:t.noop,deleteItem:t.noop};e.prototype={width:"auto",height:"auto",updateOnResize:!0,rowClass:t.noop,rowRenderer:null,rowClick:function(n){this.editing&&this.editItem(t(n.event.target).closest("tr"))},rowDoubleClick:t.noop,rowMouseDown:t.noop,rowMouseUp:t.noop,rowMouseUut:t.noop,noDataContent:"Not found",noDataRowClass:"jsgrid-nodata-row",heading:!0,headerRowRenderer:null,headerRowClass:"jsgrid-header-row",headerCellClass:"jsgrid-header-cell",filtering:!1,filterRowRenderer:null,filterRowClass:"jsgrid-filter-row",inserting:!1,insertRowRenderer:null,insertRowClass:"jsgrid-insert-row",editing:!1,editRowRenderer:null,editRowClass:"jsgrid-edit-row",confirmDeleting:!0,deleteConfirm:"Are you sure?",selecting:!0,selectedRowClass:"jsgrid-selected-row",oddRowClass:"jsgrid-row",evenRowClass:"jsgrid-alt-row",cellClass:"jsgrid-cell",sorting:!1,sortableClass:"jsgrid-header-sortable",sortAscClass:"jsgrid-header-sort jsgrid-header-sort-asc",sortDescClass:"jsgrid-header-sort jsgrid-header-sort-desc",paging:!1,pagerContainer:null,pageIndex:1,pageSize:20,pageButtonCount:15,pagerFormat:"{Total} {itemCount} {Pen} {first} {prev} {pages} {next} {last} &nbsp;&nbsp;&nbsp;&nbsp; {Numth} {pageIndex} {Page} {Total} {pageCount} {Page}",pagePrevText:"Prev",pageNextText:"Next",pageFirstText:"First",pageLastText:"Last",pageNavigatorNextText:"...",pageNavigatorPrevText:"...",pagerContainerClass:"jsgrid-pager-container",pagerClass:"jsgrid-pager",pagerNavButtonClass:"jsgrid-pager-nav-button",pagerNavButtonInactiveClass:"jsgrid-pager-nav-inactive-button",pageClass:"jsgrid-pager-page",currentPageClass:"jsgrid-pager-current-page",customLoading:!1,pageLoading:!1,autoload:!1,controller:h,loadIndication:!0,loadIndicationDelay:500,loadMessage:"Please, wait...",loadShading:!0,invalidMessage:"Invalid data entered!",invalidNotify:function(n){var i=t.map(n.errors,function(n){return n.message||null});showMsg([this.invalidMessage].concat(i).join("<br>"),"info")},onInit:t.noop,onRefreshing:t.noop,onRefreshed:t.noop,onPageChanged:t.noop,onItemDeleting:t.noop,onItemDeleted:t.noop,onItemInserting:t.noop,onItemInserted:t.noop,onItemEditing:t.noop,onItemUpdating:t.noop,onItemUpdated:t.noop,onItemInvalid:t.noop,onDataLoading:t.noop,onDataLoaded:t.noop,onOptionChanging:t.noop,onOptionChanged:t.noop,onError:t.noop,invalidClass:"jsgrid-invalid",containerClass:"jsgrid",tableClass:"jsgrid-table",gridHeaderClass:"jsgrid-grid-header",gridBodyClass:"jsgrid-grid-body",_init:function(n){t.extend(this,n);this._initLoadStrategy();this._initController();this._initFields();this._attachWindowLoadResize();this._attachWindowResizeCallback();this._callEventHandler(this.onInit);this.dfheight||(this.dfheight=this.height)},loadStrategy:function(){return this.pageLoading?new jsGrid.loadStrategies.PageLoadingStrategy(this):new jsGrid.loadStrategies.DirectLoadingStrategy(this)},_initLoadStrategy:function(){this._loadStrategy=u(this.loadStrategy,this)},_initController:function(){this._controller=t.extend({},h,u(this.controller,this))},renderTemplate:function(n,t,r){args=[];for(var f in r)args.push(r[f]);return args.unshift(n,t),n=u.apply(null,args),n===i||n===null?"":n},loadIndicator:function(n){return new jsGrid.LoadIndicator(n)},validation:function(n){return jsGrid.Validation&&new jsGrid.Validation(n)},_initFields:function(){var n=this;n.fields=t.map(n.fields,function(i){if(t.isPl