UNPKG

js-pkg

Version:
10 lines 205 kB
/*! * filename: ej.heatmap.min.js * version : 15.3.0.33 * Copyright Syncfusion Inc. 2001 - 2017. All rights reserved. * Use of this code is subject to the terms of our license. * A copy of the current license can be obtained at any time by e-mailing * licensing@syncfusion.com. Any infringement will be prosecuted under * applicable laws. */ (function(n){typeof define=="function"&&define.amd?define(["./../common/ej.core.min","./../common/ej.data.min","./../common/ej.globalize.min","./../common/ej.touch.min","./../common/ej.scroller.min","./../web/ej.tooltip.min"],n):n()})(function(){var n,t,i;(function(n,t){"use strict";var i=function(){function i(n,i){this._heatmap=i?i:null;i&&(i._grid=this);this._rootCSS="e-grid";this.element=null;this.validTags=["div"];this.model=null;this._requiresID=!0;this.keyConfigs={focus:"e",insertRecord:"45",deleteRecord:"46",editRecord:"113",saveRequest:"13",cancelRequest:"27",nextPage:"34",previousPage:"33",lastPage:"ctrl+alt+34",firstPage:"ctrl+alt+33",nextPager:"alt+34",previousPager:"alt+33",firstCellSelection:"36",lastCellSelection:"35",firstRowSelection:"ctrl+36",lastRowSelection:"ctrl+35",upArrow:"38",downArrow:"40",rightArrow:"39",leftArrow:"37",moveCellRight:"9",moveCellLeft:"shift+9",selectedGroupExpand:"alt+40",totalGroupExpand:"ctrl+40",selectedGroupCollapse:"alt+38",totalGroupCollapse:"ctrl+38",multiSelectionByUpArrow:"shift+38",multiSelectionByDownArrow:"shift+40"};this._ignoreOnPersist=["query","isEdit","toolbarClick","queryCellInfo","mergeCellInfo","currentViewData","enableAltRow","enableRTL","contextClick","contextOpen","rowDataBound","rowTemplate","detailsDataBound","detailsTemplate","childGrid","summaryRows","toolbarSettings","editSettings","allowMultiSorting","enableAutoSaveOnSelectionChange","locale","allowCellMerging","allowTextWrap","textWrapSettings","cssClass","dataSource","groupSettings.enableDropAreaAnimation","enableRowHover","showSummary","allowGrouping","enableHeaderHover","allowKeyboardNavigation","scrollSettings.frozenRows","scrollSettings.frozenColumns","enableTouch","contextMenuSettings.enableContextMenu","exportToExcelAction","exportToWordAction","exportToPdfAction"];this.ignoreOnExport=["isEdit","toolbarClick","query","queryCellInfo","selectionType","currentViewData","rowDataBound","rowTemplate","detailsDataBound","detailsTemplate","editSettings","pageSettings","enableAutoSaveOnSelectionChange","localization","allowScrolling","cssClass","dataSource","groupSettings.enableDropAreaAnimation","enableRowHover","allowSummary","enableHeaderHover","allowKeyboardNavigation"];this.observables=["dataSource","selectedRowIndex","pageSettings.currentPage"];this._tags=[{tag:"columns",attr:["allowEditing","allowFiltering","allowGrouping","allowResizing","allowSorting","cssClass","customAttributes","dataSource","defaultValue","disableHtmlEncode","editTemplate","editType","foreignKeyField","foreignKeyValue","headerTemplateID","headerText","isFrozen","isIdentity","isPrimaryKey","filterBarTemplate","textAlign","templateID","textAlign","headerTextAlign","tooltip","clipMode","validationRules.minlength","validationRules.maxlength","validationRules.range","validationRules.number","validationRules.required","editParams.decimalPlaces",[{tag:"commands",attr:["type","buttonOptions"]}]],content:"template"},{tag:"summaryRows",attr:["showCaptionSummary","showTotalSummary",[{tag:"summaryColumns",attr:["customSummaryValue","dataMember","displayColumn","summaryType","template"]}]]},{tag:"stackedHeaderRows",attr:[[{tag:"stackedHeaderColumns",attr:["headerText","column"]}]]},{tag:"filterSettings.filteredColumns",attr:[]},{tag:"sortSettings.sortedColumns",attr:[]}];this._dataSource=t.util.valueFunction("dataSource");this._selectedRow=t.util.valueFunction("selectedRowIndex");this._currentPage=t.util.valueFunction("pageSettings.currentPage");this.dataTypes={dataSource:"data",query:"data",columns:"array",childGrid:"parent",gridLines:"enum",summaryRows:"array",stackedHeaderRows:"array",toolbarSettings:{toolbarItems:"array",customToolbarItems:"array"},contextMenuSettings:{contextMenuItems:"array",customContextMenuItems:"array",subContextMenu:"array"},selectionSettings:{selectionMode:"array",selectedRecords:"array"},sortSettings:{sortedColumns:"array"},filterSettings:{filteredColumns:"array",filterType:"enum",filterBarMode:"enum"},groupSettings:{groupedColumns:"array"},editSettings:{editMode:"enum",formPosition:"enum",rowPosition:"enum"},searchSettings:{fields:"array"},textWrapSettings:{wrapMode:"enum"}};this.model={allowPaging:!1,showColumnChooser:!1,gridLines:"both",allowSorting:!1,showStackedHeader:!1,selectedRecords:[],stackedHeaderRows:[],allowFiltering:!1,allowMultipleExporting:!1,allowSelection:!0,allowGrouping:!1,showSummary:!1,allowResizing:!1,allowResizeToFit:!1,allowTextWrap:!1,allowCellMerging:!1,enableRowHover:!0,enablePersistence:!1,enableFocusout:!1,selectedRowIndex:-1,allowSearching:!1,enableToolbarItems:!1,enableHeaderHover:!1,allowReordering:!1,allowKeyboardNavigation:!0,allowRowDragAndDrop:!1,enableTouch:!0,columnLayout:"auto",selectionType:"single",dataSource:null,cssClass:"",allowScrolling:!1,locale:"en-US",enableAutoSaveOnSelectionChange:!0,allowMultiSorting:!1,exportToExcelAction:"",exportToWordAction:"",exportToPdfAction:"",_groupingCollapsed:[],editSettings:{allowEditing:!1,showAddNewRow:!1,allowAdding:!1,allowDeleting:!1,editMode:"normal",rowPosition:"top",dialogEditorTemplateID:null,allowEditOnDblClick:!0,externalFormTemplateID:null,inlineFormTemplateID:null,formPosition:"bottomleft",titleColumn:null,showConfirmDialog:!0,showDeleteConfirmDialog:!1},selectionSettings:{selectionMode:["row"],enableToggle:!1,cellSelectionMode:"flow"},pageSettings:{pageSize:12,pageCount:8,currentPage:1,totalPages:null,enableTemplates:!1,showDefaults:!1,template:null,totalRecordsCount:null,enableQueryString:!1,printMode:"allpages"},groupSettings:{showDropArea:!0,showToggleButton:!1,showGroupedColumn:!0,showUngroupButton:!0,enableDropAreaAutoSizing:!0,captionFormat:null,groupedColumns:[]},contextMenuSettings:{enableContextMenu:!1,contextMenuItems:["Add Record","Edit Record","Delete Record","Sort In Ascending Order","Sort In Descending Order","Next Page","Last Page","Previous Page","First Page","Save","Cancel","Grouping","Ungrouping"],customContextMenuItems:[],subContextMenu:[],disableDefaultItems:!1},filterSettings:{filterType:"filterbar",filterBarMode:"immediate",showFilterBarStatus:!0,statusBarWidth:450,showPredicate:!1,filteredColumns:[],enableInterDeterminateState:!0,maxFilterChoices:1e3,enableCaseSensitivity:!1,immediateModeDelay:1500,enableComplexBlankFilter:!0,blankValue:""},searchSettings:{fields:[],key:"",operator:"contains",ignoreCase:!0},sortSettings:{sortedColumns:[]},toolbarSettings:{showToolbar:!1,toolbarItems:[],customToolbarItems:[]},minWidth:0,currentIndex:0,rowDropSettings:{dropMapper:null,dragMapper:null,dropTargetID:null},scrollSettings:{width:"auto",height:0,enableTouchScroll:!0,allowVirtualScrolling:!1,virtualScrollMode:"normal",frozenRows:0,frozenColumns:0,buttonSize:18,autoHide:!1,scrollerSize:18,scrollOneStepBy:57,enableVirtualization:!1},textWrapSettings:{wrapMode:"both"},summaryRows:[],enableRTL:!1,enableAltRow:!0,currentViewData:null,detailsTemplate:null,childGrid:null,keySettings:null,rowTemplate:null,detailsDataBound:null,rowDataBound:null,queryCellInfo:null,mergeCellInfo:null,create:null,actionBegin:null,actionComplete:null,actionFailure:null,beginEdit:null,endEdit:null,endAdd:null,endDelete:null,beforeBatchAdd:null,beforeBatchSave:null,beforeBatchDelete:null,batchAdd:null,batchDelete:null,cellSave:null,cellEdit:null,resizeStart:null,resizeEnd:null,resized:null,load:null,destroy:null,rowSelecting:null,rowSelected:null,cellSelecting:null,cellSelected:null,columnSelecting:null,columnSelected:null,columnDragStart:null,columnDrag:null,columnDrop:null,dataBound:null,recordClick:null,recordDoubleClick:null,templateRefresh:null,rightClick:null,detailsCollapse:null,detailsExpand:null,toolbarClick:null,contextOpen:null,contextClick:null,columns:[],query:null,isEdit:!1,isResponsive:!1,enableResponsiveRow:!1,virtualLoading:null}}return i.prototype._dataSource=t.util.valueFunction("dataSource"),i.prototype._selectedRow=t.util.valueFunction("selectedRowIndex"),i.prototype._currentPage=t.util.valueFunction("pageSettings.currentPage"),i.prototype._mapValues=function(){},i.prototype._createElement=function(i,r){this.element=i.jquery?i:n(i);this.sfType="ej-grid";this.pluginName="ej.Grid";this.model=t.copyObject(!0,{},this.model,r);this.model.keyConfigs=t.copyObject(this.keyConfigs);this.element.addClass("e-grid e-js").data("ej.Grid",this)},i.prototype._init=function(n,i,r){var f,u,e;this._createElement(n,i);!t.isNullOrUndefined(this.model.query)&&this.model.query instanceof t.Query||(this.model.query=t.Query());t.isNullOrUndefined(this.model.parentDetails)||(f=this.model.queryString,u=this.model.foreignKeyField,this.model.query=this.model.query.clone(),e=this.model.parentDetails.parentKeyFieldValue===undefined?"undefined":this.model.parentDetails.parentKeyFieldValue,this.model.query.where(t.isNullOrUndefined(u)?f:u,"equal",e,!0));this._initPrivateProperties();this._initScrolling();this.model.enableResponsiveRow&&this.element.addClass("e-responsive");this._checkForeignKeyBinding();this._checkDataBinding(r);this._refreshScroller({})},i.prototype._checkDataBinding=function(n){var i,u,r,f;if(!this.model.columns.length&&((this._dataSource()==null||!this._dataSource().length)&&!(this._dataSource()instanceof t.DataManager)||this._dataSource()instanceof t.DataManager&&this._dataManager.dataSource.url==undefined&&!this._dataSource().dataSource.json.length)){this._alertDialog.find(".e-content").text(this.localizedLabels.EmptyDataSource);this._alertDialog.ejDialog("open");return}if(this._initialRenderings(),this.model.editSettings.allowDeleting&&this.model.selectionType=="multiple"&&(this.multiDeleteMode=!0),this.initialRender=!0,this.model.enableRTL&&this.element.addClass("e-rtl"),this.model.allowFiltering&&this._isExcelFilter&&this._renderExcelFilter(),this.model.cssClass!=null&&this.element.addClass(this.model.cssClass),this.model.allowGrouping&&this.element.append(this._renderGroupDropArea()),(this.model.toolbarSettings.showToolbar||(this.model.allowSorting||this.model.allowFiltering)&&this.model.enableResponsiveRow)&&this.element.append(this._renderToolBar()),i=this.model.columns,i&&i.length){if(u=this.model.query._expands,typeof i[0]=="string")for(r=0;r<i.length;r++)i[r]={field:i[r]};for(r=0;r<i.length;r++)i[r].field&&i[r].field.indexOf(".")!==-1&&this._getExpands(i[r].field,u);this.model.query.expand(u);this.commonQuery.expand(u);this._renderAfterColumnInitialize()}this.model.allowPaging&&this.element.append(this._renderGridPager());this.model.contextMenuSettings.enableContextMenu&&this.element.append(this._renderContext());this.model.scrollSettings.allowVirtualScrolling&&(this._loadedJsonData=[],this._prevPage=1);this._dataSource()instanceof t.DataManager?this._dataSource().ready!=undefined?(f=this,this._dataSource().ready.done(function(n){f._initDataSource();f.model.dataSource=t.DataManager(n.result)})):this._initDataSource():(this._ensureDataSource(),this._setForeignKeyData(),this._relationalColumns.length==0&&this._initGridRender(n),this._vRowHeight=Math.floor(this.getRowHeight()));this.model.showColumnChooser&&this._renderColumnChooser()},i.prototype._initialRenderings=function(){var r,i;if(this.model.groupSettings.groupedColumns.length){for(r=[],i=0;i<this.model.sortSettings.sortedColumns.length;i++)t.isNullOrUndefined(this.model.sortSettings.sortedColumns[i].direction)&&(this.model.sortSettings.sortedColumns[i].direction=t.sortOrder.Ascending),r.push(this.model.sortSettings.sortedColumns[i].field);if(this.model.allowGrouping)for(i=0;i<this.model.groupSettings.groupedColumns.length;i++)n.inArray(this.model.groupSettings.groupedColumns[i],r)==-1&&this.model.sortSettings.sortedColumns.push({field:this.model.groupSettings.groupedColumns[i],direction:t.sortOrder.Ascending})}},i.prototype._renderAfterColumnInitialize=function(){this.element.append(this._renderGridHeader())},i.prototype.setGridHeaderContent=function(n){this._gridHeaderContent=n},i.prototype._renderGridHeader=function(){var n=t.buildTag("div.e-gridheader"),r,u,i=t.buildTag("div");return this.model.allowScrolling&&i.addClass("e-headercontent"),this.setGridHeaderContent(n),this.initialRender&&(this.columnsWidthCollection=[],this._hiddenColumns=[],this._hiddenColumnsField=[]),this._visibleColumns=[],this._visibleColumnsField=[],this._disabledGroupableColumns=[],this._fieldColumnNames={},this._headerColumnNames={},this.model.scrollSettings.frozenColumns>0?(r=t.buildTag("div.e-frozenheaderdiv",this._renderGridHeaderInternalDesign(this.model.columns.slice(0,this.model.scrollSettings.frozenColumns),!0)),u=t.buildTag("div.e-movableheader",t.buildTag("div.e-movableheaderdiv",this._renderGridHeaderInternalDesign(this.model.columns.slice(this.model.scrollSettings.frozenColumns),!1))),i.append(r).append(u)):i.append(this._renderGridHeaderInternalDesign(this.model.columns)),n.html(i),this.model.isResponsive&&n.addClass("e-textover"),this.setGridHeaderTable(this.getHeaderContent().find(".e-table")),n},i.prototype.setGridHeaderTable=function(n){this._gridHeaderTable=n},i.prototype._renderGridHeaderInternalDesign=function(i,r){var y=t.buildTag("table.e-table","",{},{"data-role":"heatmap"}),c=t.buildTag("thead"),p=t.buildTag("tbody.e-hide"),l=t.buildTag("tr.e-columnheader"),a=n(document.createElement("colgroup")),w=n(document.createElement("tr")),b,u,v,h,s,o;if((this.model.childGrid||this.model.detailsTemplate)&&(l.append(t.buildTag("th.e-headercell e-detailheadercell","<div><\/div>")),a.append(this._getIndentCol())),this.model.showStackedHeader)for(o=0;o<this.model.stackedHeaderRows.length;o++)b=this._createStackedRow(this.model.stackedHeaderRows[o],r),c.append(b);for(u=0;u<i.length;u++){var e=t.buildTag("th.e-headercell e-default","",{},{"data-role":"columnheader"}),k=document.createElement("td"),f=t.buildTag("div.e-headercelldiv",i[u].headerText===undefined?i[u].headerText=i[u].field:i[u].headerText,{},{"data-ej-mappingname":i[u].field});if(i[u].disableHtmlEncode&&f.text(i[u].headerText),t.isNullOrUndefined(i[u].headerTooltip)||f.addClass("e-headertooltip"),t.isNullOrUndefined(i[u].tooltip)||f.addClass("e-gridtooltip"),(i[u].clipMode==t.HeatMapGrid.ClipMode.Ellipsis||i[u].clipMode==t.HeatMapGrid.ClipMode.EllipsisWithTooltip)&&f.addClass("e-gridellipsis"),e.append(f),this.model.allowFiltering&&(this.model.filterSettings.filterType=="menu"||this.model.filterSettings.filterType=="excel")&&(i[u].allowFiltering==undefined||i[u].allowFiltering===!0)&&(!t.isNullOrUndefined(i[u].field)||i[u].field=="")){if(v="e-filterset",!this.initialRender&&this.model.filterSettings.filteredColumns)for(h=0;h<this.model.filterSettings.filteredColumns.length;h++)this.model.filterSettings.filteredColumns[h].field==i[u].field&&(v="e-filterset e-filteredicon e-filternone");e.append(t.buildTag("div.e-filtericon e-icon "+v));e.addClass("e-headercellfilter");t.browserInfo().name=="msie"&&t.browserInfo().version=="8.0"&&this.model.enableRTL&&n(f).css("padding","0 0 0 2em")}s=document.createElement("col");i[u].priority&&n(k).addClass("e-table-priority-"+i[u].priority);w.append(k);l.append(e);a.append(s);i[u].visible===!1?(e.addClass("e-hide")&&n(s).css("display","none"),n.inArray(i[u].headerText,this._hiddenColumns)==-1&&n.inArray(i[u].field,this._hiddenColumnsField)==-1&&(this._hiddenColumns.push(i[u].headerText)&&i[u].field!=(""||undefined)?this._hiddenColumnsField.push(i[u].field):this._hiddenColumnsField.push(i[u].headerText)),n.inArray(i[u].field,this._visibleColumnsField)!=-1&&this._visibleColumnsField.splice(n.inArray(i[u].field,this._visibleColumnsField),1)&&this._visibleColumns.splice(n.inArray(i[u].headerText,this._visibleColumns),1)):(this._visibleColumns.push(i[u].headerText)&&i[u].field!=(""||undefined)?this._visibleColumnsField.push(i[u].field):this._visibleColumnsField.push(i[u].headerText),i[u].visible=!0,n.inArray(i[u].field==""?i[u].headerText:i[u].field,this._hiddenColumnsField)!=-1&&this._hiddenColumnsField.splice(n.inArray(i[u].field==""?i[u].headerText:i[u].field,this._hiddenColumnsField),1)&&this._hiddenColumns.splice(n.inArray(i[u].headerText,this._hiddenColumns),1));this.model.showColumnChooser&&i[u].showInColumnChooser!==!1&&(i[u].showInColumnChooser=!0);this.model.allowResizing&&i[u].allowResizing!==!1&&(i[u].allowResizing=!0);t.isNullOrUndefined(i[u].headerTextAlign)?i[u].textAlign!=undefined?f.css("text-align",i[u].textAlign):this.model.enableRTL&&f.css("text-align",i[u].textAlign="right"):f.css("text-align",i[u].headerTextAlign);i[u].allowResizing===!1&&this._disabledResizingColumns.push(i[u].field);i[u].allowSorting===!1&&this._disabledSortableColumns.push(i[u].field);i[u].allowGrouping===!1&&this._disabledGroupableColumns.push(i[u].field);i[u].allowEditing===!1&&this._disabledEditableColumns.push(i[u].field);t.isNullOrUndefined(i[u].cssClass)||(e.addClass(i[u].cssClass),n(s).addClass(i[u].cssClass));t.isNullOrUndefined(i[u].headerTemplateID)||(f.html(n(i[u].headerTemplateID).hide().html()).parent().addClass("e-headertemplate"),o=n.inArray(i[u].field,this._disabledGroupableColumns),o==-1&&t.isNullOrUndefined(i[u].field)&&this._disabledGroupableColumns.push(i[u].field));this.model.isResponsive&&e.attr("title",this._decode(i[u].headerText));i[u].priority&&(e.attr("data-priority",i[u].priority).addClass("e-table-priority-"+i[u].priority),n(s).addClass("e-table-priority-"+i[u].priority));this.initialRender&&(typeof i[u].width=="string"&&i[u].width.indexOf("%")!=-1?this.columnsWidthCollection.push(parseInt(i[u].width)/100*this.element.width()):this.columnsWidthCollection.push(i[u].width));i[u].width==undefined&&this.model.commonWidth!==undefined&&(this.columnsWidthCollection[u]=this.model.commonWidth);this._fieldColumnNames[i[u].headerText]=i[u].field;this._headerColumnNames[i[u].field]=i[u].headerText}return c.append(l),p.append(w),y.append(a).append(c).append(p),y},i.prototype._decode=function(t){return n("<div/>").html(t).text()},i.prototype._checkForeignKeyBinding=function(){if(this.model.columns.length){var i,r,u,n;for(i=0,r=this.model.columns,u=r.length;i<u;i++)n=r[i],n.hasOwnProperty("foreignKeyField")&&n.dataSource instanceof t.DataManager&&this._relationalColumns.push({field:n.field,key:n.foreignKeyField,value:n.foreignKeyValue,dataSource:n.dataSource});this._$fkColumn=!0}},i.prototype._initScrolling=function(){for(var u,r=[],f=[],e=0,i=0;i<this.model.columns.length;i++)this.model.columns[i].visible===!1&&i<this.model.scrollSettings.frozenColumns&&e++,this.model.columns[i].isFrozen===!0?r.push(this.model.columns[i]):f.push(this.model.columns[i]);(r.length>0&&(u=this.model.scrollSettings.frozenColumns,this.model.columns=n.merge(n.merge([],r),f),this.model.scrollSettings.frozenColumns=r.length,r.length!=u&&u!=0&&(this.model.scrollSettings.frozenColumns=u)),(this.model.scrollSettings.frozenColumns>0||this.model.scrollSettings.frozenRows>0)&&(this.model.allowGrouping||this.model.rowTemplate!=null||this.model.detailsTemplate!=null||this.model.childGrid!=null||this.model.scrollSettings.allowVirtualScrolling||this.model.editSettings.editMode=="batch"))||(this.model.scrollSettings.allowVirtualScrolling&&this.model.allowScrolling&&(this.model.scrollSettings.enableVirtualization?(this._vRowHeight=Math.floor(this.getRowHeight()+1),this._virtualRowCount=Math.round(this.model.scrollSettings.height/this._vRowHeight)+1,this.model.pageSettings.pageSize<this._virtualRowCount*5&&(this.model.pageSettings.pageSize=this._virtualRowCount*5)):(this.model.pageSettings.pageSize=this.model.pageSettings.pageSize==12?Math.round(this.model.scrollSettings.height/32)+1:this.model.pageSettings.pageSize,this.model.pageSettings.totalPages=Math.ceil(this._gridRecordsCount/this.model.pageSettings.pageSize))),(this.model.width||this.model.height)&&(this.model.allowScrolling=!0,this.model.width&&(this.model.scrollSettings.width=this.model.width),this.model.height&&(this.model.scrollSettings.height=this.model.height)),this._originalScrollWidth=t.isNullOrUndefined(this.model.scrollSettings.previousStateWidth)?this.model.scrollSettings.width:this.model.scrollSettings.previousStateWidth)},i.prototype._initPrivateProperties=function(){this._click=0;this._tabKey=!1;this._gridHeaderTable=null;this._gridWidth=this.element.width();this._id=this.element.attr("id");this._gridRows=null;this._unboundRow=null;this._gridContentTable=null;this._gridContent=null;this._remoteSummaryData=null;this._gridSort=null;this._gridHeaderContent=null;this._gridFooterContent=null;this._gridFooterTable=null;this._gridRecordsCount=this._dataSource()!==null?this.model.pageSettings.totalRecordsCount==null?this._dataSource().length:this.model.pageSettings.totalRecordsCount:0;this._links=null;this._gridPager=null;this._cSortedColumn=null;this._cSortedDirection=null;this._$curSElementTarget=null;this._gridFilterBar=null;this._$curFieldName=null;this._$prevFieldName=null;this._mediaStatus=!1;this._$fDlgIsOpen=!1;this._$menuDlgIsOpen=!1;this._$colType=null;this._$colFormat=null;this._$prevColType=null;this._$prevSElementTarget=null;this._currentFilterColumn=null;this._filteredRecordsCount=null;this._filteredRecords=[];this._validatedColumns=[];this.filterColumnCollection=[];this._previousFilterCount=null;this._excelFilter=null;this._isExcelFilter=this.model.filterSettings.filterType=="excel";this._$fkColumn=!1;this._fkParentTblData=[];this._primaryKeys=[];this._identityKeys=[];this._primaryKeyValues=[];this._modifiedRecords=[];this._addedRecords=[];this._tdsOffsetWidth=[];this._deletedRecords=[];this._disabledToolItems=n();this._validationRules={};this._groupedColumns=[];this._scolumns=[];this._currentJsonData=[];this._groupingColumnIndex=0;this._dataManager=this._dataSource()instanceof t.DataManager?this._dataSource():this._dataSource()!=null?t.DataManager(this._dataSource()):null;this._dataManager!=null&&this.model.allowScrolling&&this.model.scrollSettings.allowVirtualScrolling&&this.model.pageSettings.totalRecordsCount!=null&&this._dataManager.dataSource.json!=null&&this._dataManager.dataSource.json.splice(this.model.pageSettings.totalRecordsCount);this._isRemoteSaveAdaptor=this._dataSource()instanceof t.DataManager&&this._dataSource().adaptor instanceof t.remoteSaveAdaptor;this._isLocalData=!0;this._disabledResizingColumns=[];this._disabledSortableColumns=[];this._disabledGroupableColumns=[];this._disabledFilterableColumns=[];this._disabledEditableColumns=[];this._hiddenColumns=[];this._visibleColumns=[];this._visibleColumnsField=[];this._hiddenColumnsField=[];this._ccVisibleColumns=[];this._ccHiddenColumns=[];this._sortedColumns=[];this.multiSortRequest=!1;this.multiSelectCtrlRequest=!1;this.multiSelectShiftRequest=!1;this._enableSelectMultiTouch=!1;this._enableSortMultiTouch=!1;this._templateRefresh=!1;this.initialRender=!1;this._selectDrag=!1;this._isAddNew=!1;this._fieldColumnNames={};this._headerColumnNames={};this._virtualLoadedRecords={};this._virtualLoadedRows={};this._virtualPageRecords={};this._queryCellView=[];this._currentPageViews=[];this._virtualLoadedPages=[];this._currentLoadedIndexes=[];this._prevVirtualSort=[];this._prevVirtualFilter=[];this._prevVirtualIndex=0;this._currentVirtualIndex=1;this._virtualRowCount=0;this._virtualSelectedRecords={};this.selectedRowsIndexes=[];this._isReorder=!1;this._searchString="";this._searchCount=null;this.columnsWidthCollection=[];this._Indicator=null;this._resizer=null;this._bulkEditCellDetails={cellValue:null,rowIndex:-1,columnIndex:-1,fieldName:null,_data:null,cellEditType:"",cancelSave:!1,defaultData:null,insertedTrCollection:[],rowData:null};this.batchChanges={added:[],deleted:[],changed:[]};this._bulkEditTemplate=n();this._confirmDialog=null;this._confirmedValue=!1;this._lastRow=!1;this._isVirtualRecordsLoaded=!1;this._scrollValue=0;this._currentTopFrozenRow=this.model.scrollSettings.frozenRows;this._rowHeightCollection=[];this._scrollObject=null;this._customPop=null;this.selectedRowCellIndexes=[];this._rowIndexesColl=[];this.selectedColumnIndexes=[];this._allowrowSelection=this._allowcellSelection=this._allowcolumnSelection=!1;this.commonQuery=n.extend(!0,{},this.model.query);this.phoneMode=this.model.isResponsive&&document.documentElement.clientWidth<360?!0:!1;this.model.selectionSettings.selectionMode.length>0&&this.model.allowSelection&&this._initSelection();this._mediaQuery=!1;this._columnChooserList=null;this._$headerCols=null;this._$contentCols=null;this._detailsOuterWidth=null;this._editForm=null;this._cloneQuery=null;this.localizedLabels=this._getLocalizedLabels();this._searchBar=null;this._relationalColumns=[];this._dropDownManager={};this._isUngrouping=!1;this._columnChooser=!1},i.prototype._getLocalizedLabels=function(){return t.getLocalizedConstants("ej.HeatMapGrid",this.model.locale)},i.prototype._initSelection=function(){for(var t=this.model.selectionSettings.selectionMode,n=0;n<t.length;n++)this["_allow"+t[n]+"Selection"]=!0},i.prototype._getSelectedViewData=function(t,i,r){var o=t%this._virtualRowCount,u,f={},e;return u=i?parseInt(n(i).closest("tr").attr("name"),32):r?r:t>1?Math.ceil((t+1)/this._virtualRowCount):1,f.viewIndex=u,this._virtualLoadedRecords[u]&&(f.data=this._virtualLoadedRecords[u][o]),e=t%this._virtualRowCount,f.rowIndex=u*this._virtualRowCount-(this._virtualRowCount-e),f},i.prototype._frozenCell=function(t,i){var r=i,u=0,f=this.getRowByIndex(t);return i>=this.model.scrollSettings.frozenColumns&&(u=1,r=r-this.model.scrollSettings.frozenColumns),n(f.eq(u).find(".e-rowcell:eq("+r+")"))},i.prototype.selectCells=function(i){var r,e,o,c,s,u,h,f;if(!this._allowcellSelection)return!1;r=null;c=this._excludeDetailRows();r=this.model.scrollSettings.frozenColumns?this._frozenCell(i[0][0],i[0][1][0]):c.eq(i[0][0]).find(".e-rowcell:eq("+i[0][1]+")");t.isNullOrUndefined(this._previousRowCellIndex)||this._previousRowCellIndex.length==0||(this.model.scrollSettings.enableVirtualization?(e=this._prevRowCell,o=this._preVirRowCellIndex):(e=n(this.getRowByIndex(this._previousRowCellIndex[0][0]).find(".e-rowcell:eq("+this._previousRowCellIndex[0][1]+")")),o=this._previousRowCellIndex));s=this._currentJsonData[i[0][0]];u=i[0][0];this.model.scrollSettings.allowVirtualScrolling&&this.model.scrollSettings.enableVirtualization&&(h=this._getSelectedViewData(i[0][0],r),s=h.data,u=h.rowIndex);f={currentCell:r,cellIndex:i[0][1],data:s,previousRowCellIndex:o,previousRowCell:e};this.model.selectionType=="multiple"&&(f.isCtrlPressed=this.multiSelectCtrlRequest,f.isShiftPressed=this.multiSelectShiftRequest);switch(this.model.selectionType){case t.HeatMapGrid.SelectionType.Single:this.clearCellSelection();this.clearColumnSelection();this.selectedRowCellIndexes=[];this._virtualRowCellSelIndex=[];n.inArray(u,this._rowIndexesColl)==-1&&this._rowIndexesColl.push(u);this.selectedRowCellIndexes.push({rowIndex:u,cellIndex:i[0][1]});this.model.scrollSettings.frozenColumns?this._frozenCell(i[0][0],i[0][1][0]).addClass("e-cellselectionbackground e-activecell"):n(this.getRowByIndex(i[0][0]).find(".e-rowcell:eq("+i[0][1]+")")).addClass("e-cellselectionbackground e-activecell")}f={currentCell:r,cellIndex:i[0][1],data:s,selectedRowCellIndex:this.selectedRowCellIndexes,previousRowCellIndex:o,previousRowCell:e};(!this.multiSelectShiftRequest||t.isNullOrUndefined(this._previousRowCellIndex))&&(this._previousRowCellIndex=i,this.model.scrollSettings.allowVirtualScrolling&&this.model.scrollSettings.enableVirtualization&&(this._preVirRowCellIndex=n.extend(!0,[],i),this._preVirRowCellIndex[0][0]=u),this._prevRowCell=r);this._heatmap&&this._heatmap._cellSelected(f);return},i.prototype.clearSelection=function(i){var r,i,u,f,e;return this._selectedRow()>=-1&&(r=this.model.scrollSettings.frozenColumns?this._excludeDetailRows():n(this.element.find("tr[aria-selected='true']")),t.isNullOrUndefined(i)?(this.model.scrollSettings.frozenColumns>0&&(r=n(r[0]).add(r[1])),r.removeAttr("aria-selected").find(".e-rowcell, .e-detailrowcollapse, .e-detailrowexpand").removeClass("e-selectionbackground").removeClass("e-active"),this._clearVirtualSelection||(this.selectedRowsIndexes=[],this.model.selectedRecords=[])):(this.getRowByIndex(i).removeAttr("aria-selected").find(".e-selectionbackground").removeClass("e-selectionbackground").removeClass("e-active"),u=this.getRowByIndex(i),this.model.scrollSettings.enableVirtualization&&this.multiSelectCtrlRequest&&n.inArray(i,this.selectedRowsIndexes)==-1&&(f=parseInt(u.attr("name"),32)*this._virtualRowCount,e=this._virtualRowCount-u.index()%this._virtualRowCount,i=f-e),i=n.inArray(i,this.selectedRowsIndexes),i!=-1&&this.selectedRowsIndexes.splice(i,1)),this.selectedRowsIndexes.length||this._selectedRow(-1)),!0},i.prototype._excludeDetailRows=function(){return t.isNullOrUndefined(this.model.detailsTemplate||this.model.childGrid||this.model.showSummary)?n(this.getRows()):n(this.getRows()).not(".e-detailrow,.e-gridSummaryRows")},i.prototype.clearCellSelection=function(i,r){var f,e,u;if(this._allowcellSelection)if(f=this.model.scrollSettings.frozenColumns||!t.isNullOrUndefined(i)?this._excludeDetailRows():n(this.element.find(".e-cellselectionbackground")).parent(),t.isNullOrUndefined(i))this.model.scrollSettings.frozenColumns&&(f=n(f[0]).add(f[1])),f.find(".e-rowcell, .e-detailrowcollapse, .e-detailrowexpand").removeClass("e-cellselectionbackground").removeClass("e-activecell"),this.selectedRowCellIndexes=[],this._rowIndexesColl=[];else{for(u=0;u<this.selectedRowCellIndexes.length;u++)if(this.selectedRowCellIndexes[u].rowIndex==i){e=n.inArray(r,this.selectedRowCellIndexes[u].cellIndex);this.model.scrollSettings.frozenColumns?this._frozenCell(i,r).removeClass("e-cellselectionbackground").removeClass("e-activecell"):f.eq(i).find(".e-rowcell").eq(r).removeClass("e-cellselectionbackground").removeClass("e-activecell");break}u!=this.selectedRowCellIndexes.length&&(this.selectedRowCellIndexes[u].cellIndex.splice(e,1),this.selectedRowCellIndexes[u].cellIndex.length==0&&(this.selectedRowCellIndexes.splice(u,1),this._rowIndexesColl.splice(n.inArray(i,this._rowIndexesColl),1)))}return!0},i.prototype.clearColumnSelection=function(i){var r,o,u,s,f,e;if(this._allowcolumnSelection)if(r=n(this._excludeDetailRows()),t.isNullOrUndefined(i))this.model.scrollSettings.frozenColumns&&(r=n(r[0]).add(r[1])),r.find(".e-rowcell").removeClass("e-columnselection"),n(this.getHeaderTable().find("th.e-headercell:not(.e-stackedHeaderCell)")).removeClass("e-columnselection"),this.selectedColumnIndexes=[];else{if(o=0,(this.model.detailsTemplate!=null||this.model.childGrid!=null)&&(++i,o=1),this.model.scrollSettings.frozenColumns)for(u=0,s=i,i>=this.model.scrollSettings.frozenColumns&&(u=1,s=i-this.model.scrollSettings.frozenColumns),f=0;f<r[u].length;f++)n(r[u][f].cells[s]).removeClass("e-columnselection");else for(e=0;e<r.length;e++)n(r[e].cells[i]).removeClass("e-columnselection");n(this.getHeaderTable().find("th.e-headercell:not(.e-stackedHeaderCell)")[i]).removeClass("e-columnselection");this.selectedColumnIndexes.splice(0,i-o)}return!0},i.prototype.getSelectedRecords=function(){var t=[],n;if(this._virtualScrollingSelection)return this._virtualSelRecords;for(n=0;n<this.selectedRowsIndexes.length;n++)this.selectedRowsIndexes[n]!=-1&&(this.model.scrollSettings.allowVirtualScrolling?t.push(this._virtualSelectedRecords[this.selectedRowsIndexes[n]]):t.push(this._currentJsonData[this.selectedRowsIndexes[n]]));return t},i.prototype._setCurrentRow=function(n){(n==t.HeatMapGrid.Actions.Refresh||n==t.HeatMapGrid.Actions.Ungrouping||n==t.HeatMapGrid.Actions.Grouping||n==t.HeatMapGrid.Actions.Filtering||n==t.HeatMapGrid.Actions.Sorting||n==t.HeatMapGrid.Actions.Delete||n==t.HeatMapGrid.Actions.Save||n==t.HeatMapGrid.Actions.Cancel||n==t.HeatMapGrid.Actions.Paging)&&(this._selectedRow(-1),this._virtualDataRefresh||(this.selectedRowsIndexes=[]))},i.prototype.refreshContent=function(){var n={};n.requestType=t.HeatMapGrid.Actions.Refresh;this._processBindings(n)},i.prototype.rowHeightRefresh=function(){var i,f;if(this.model.scrollSettings.frozenColumns>0&&!t.isNullOrUndefined(this.model.currentViewData)&&this.model.currentViewData.length){var u=this.getContentTable().get(0).rows,e=this.getContentTable().get(1).rows,r=0;if(this.getContent().find(".e-frozencontentdiv").is(":visible"))for(i=0;i<u.length;i++)n(u[i]).css("display")!="none"&&(r=t.max([u[i].getClientRects()[0].height,e[i].getClientRects()[0].height]),n(u[i]).height(r),n(e[i]).height(r),i&&(i==this.model.scrollSettings.frozenRows-1||i==u.length-1)&&(r=r+1),this.model.allowTextWrap||i&&i!=this.model.scrollSettings.frozenRows-1||(r=r-1),this.model.isEdit&&n(u[i]).find("#"+this._id+"EditForm").length&&i&&n(u[i]).find("#"+this._id+"EditForm td").css("height",r),n(e[i]).find("#"+this._id+"EditForm td").css("height",r));this._getRowHeights();!t.isNullOrUndefined(this.getContent().data("ejScroller"))&&this.getScrollObject().isVScroll()&&(f=this.getScrollObject()._vScrollbar,f&&f.value()!=f.model.maximum&&this._scrollObject.refresh(this.model.scrollSettings.frozenColumns>0))}},i.prototype._refreshDataSource=function(n){this._dataManager=n instanceof t.DataManager?n:t.DataManager(n);this._isLocalData=!(this._dataSource()instanceof t.DataManager)||this._dataManager.dataSource.offline||this._isRemoteSaveAdaptor;this.model.scrollSettings.allowVirtualScrolling&&this.model.scrollSettings.enableVirtualization&&(this._refreshVirtualViewData(),this._virtualDataRefresh=!0);this.refreshContent(!0);this._refreshScroller({requestType:"refresh"})},i.prototype.dataSource=function(n,t){t&&(this._templateRefresh=!0);this._dataSource(n);this.model.scrollSettings.enableVirtualization||(n.length>0?this._currentPage(1):this._currentPage(0));this._refreshDataSource(n);var i=this._refreshVirtualPagerInfo();(this.model.allowPaging||this.model.scrollSettings.allowVirtualScrolling)&&this._showPagerInformation(i);this.model.scrollSettings.allowVirtualScrolling&&(this.model.scrollSettings.enableVirtualization&&this._isLocalData?this._refreshVirtualView():this._refreshVirtualContent(),this.getContent().ejScroller("isHScroll")&&this.getContent().ejScroller("scrollX",0,!0),this.getContent().ejScroller("isVScroll")?(this.model.scrollSettings.enableVirtualization||this.getContent().ejScroller("scrollY",0,!0),this.element.find(".e-gridheader").addClass("e-scrollcss")):this.element.find(".e-gridheader").removeClass("e-scrollcss"));(!this.model.scrollSettings.enableVirtualization||this._gridRows.length<this._virtualRowCount)&&this._addLastRow();this._trigger("dataBound",{})},i.prototype._trigger=function(){},i.prototype.getFooterContent=function(){return this._gridFooterContent},i.prototype.getScrollObject=function(){return(this._scrollObject==null||t.isNullOrUndefined(this._scrollObject.model))&&(this._scrollObject=this.getContent().ejScroller("instance")),this._scrollObject},i.prototype.getRowHeight=function(){var i=-1,n,r,t;return this.getContentTable()!=null&&(n=this.getContentTable().find("tr:not(.e-virtualrow)"),r=n.length>2?1:0,n.length&&(t=n[r].getBoundingClientRect()),n.length>1&&(i=t&&t.height?t.height:n[r].offsetHeight)),i==-1?32:i},i.prototype.getCurrentIndex=function(){return(this._currentPage()-1)*this.model.pageSettings.pageSize},i.prototype.getColumnByIndex=function(n){return n<this.model.columns.length?this.model.columns[n]:null},i.prototype.set_currentPageIndex=function(n){var i=this.model.pageSettings,u=this.model.filterSettings.filteredColumns.length==0?this._searchCount==null?this._gridRecordsCount:this._searchCount:this._filteredRecordsCount,r;return(i.totalPages==null&&(i.totalPages=Math.ceil(u/i.pageSize)),n>i.totalPages||n<1||n==this._currentPage())?!1:(t.isNullOrUndefined(this._prevPageNo)&&(this._prevPageNo=this._currentPage()),this._currentPage(n),this._currentPage()!=this._prevPageNo?(r={},r.requestType="paging",this.gotoPage(this._currentPage(),r),!0):!1)},i.prototype.set_currentVirtualIndex=function(n){var t,i;return n<1||n!=1&&n!=this._totalVirtualViews&&n==this._currentVirtualIndex&&this._checkCurrentVirtualView(this._virtualLoadedRows,n)?!1:(this._prevVirtualIndex=this._currentVirtualIndex,this._currentVirtualIndex=n,t=this._calculateCurrentViewPage(),t<=this.model.pageSettings.totalPages&&!this._checkCurrentVirtualView(this._virtualLoadedRecords,this._currentVirtualIndex)?this._prevVirtualIndex<n&&n!=1?(i=this._isThumbScroll&&t!=1?t:t+1,!this._virtualPageRecords[i]&&i<=this.model.pageSettings.totalPages?this._setCurrentViewPage(i):this._renderVirtulViewContent(t)):this._prevVirtualIndex>n?(i=this._isThumbScroll?t:t-1,this._virtualPageRecords[i]&&!this._virtualLoadedRecords[n-1]&&(i=t-1),!this._virtualPageRecords[i]&&i>=1&&this._setCurrentViewPage(i)):this._renderVirtulViewContent(t):this._renderVirtulViewContent(t),!0)},i.prototype._setCurrentViewPage=function(n){this._needPaging=!0;this._prevPageNo=this._currentPage();this.gotoPage(n)},i.prototype._renderVirtulViewContent=function(){this._needPaging=!1;this._refreshVirtualView(this._currentVirtualIndex)},i.prototype._checkCurrentVirtualView=function(t,i){var f=this._virtualRowCount,u=i-1,r=i+1,e;if(t instanceof Array){if(t.length&&((u==0||r==this._totalVirtualViews+1)&&n.inArray(i,t)!=-1||n.inArray(u,t)!=-1&&n.inArray(i,t)!=-1&&n.inArray(r,t)!=-1))return!0}else if(e=r==this._totalVirtualViews?this._lastViewData:f,!this.initialRender&&i==1&&this._virtualLoadedRows[i]||i==this._totalVirtualViews&&t==this._virtualLoadedRows&&t[i]||u==0&&t[i]&&t[i].length==f||r==this._totalVirtualViews+1&&t[i]&&t[i].length==this._lastViewData||t[u]&&t[u].length==f&&t[i]&&t[i].length==f&&t[r]&&t[r].length==e)return!0;return!1},i.prototype._refreshStackedHeader=function(){var i,r,u,t;if(this.model.showStackedHeader){for(i=this.model.stackedHeaderRows,t=0;t<i.length;t++)if(this.model.scrollSettings.frozenColumns!=0){var f=n(this.getHeaderContent().find(".e-frozenheaderdiv")),e=n(this.getHeaderContent().find(".e-movableheader")),o=this._createStackedRow(i[t],!0),s=this._createStackedRow(i[t],!1);n(f.find("tr.e-stackedHeaderRow")[t]).replaceWith(o);n(e.find("tr.e-stackedHeaderRow")[t]).replaceWith(s)}else r=this._createStackedRow(i[t],!1),this.getHeaderTable().find("tr.e-stackedHeaderRow")[t]?n(this.getHeaderTable().find("tr.e-stackedHeaderRow")[t]).replaceWith(r):r.insertBefore(this.getHeaderTable().find("tr.e-columnheader:last"));if(u={},u.requestType="refresh",this.model.allowGrouping&&this.model.groupSettings.groupedColumns.length>0)for(t=0;t<this.model.groupSettings.groupedColumns.length;t++)this.getHeaderTable().find(".e-stackedHeaderRow").prepend(this._getGroupTopLeftCell());this.model.allowScrolling&&this._refreshScroller(u)}},i.prototype._getStackedColumnByTarget=function(n){var r=(n.get(0)||{}).className,i=/e-row([0-9])-column([0-9])/.exec(r),u=i[1],f=i[2],e=[u,"stackedHeaderColumns",f].join(".");return t.getObject(e,this.model.stackedHeaderRows)},i.prototype._checkSkipAction=function(n){switch(n.requestType){case t.HeatMapGrid.Actions.Save:case t.HeatMapGrid.Actions.Delete:return!0}return!1},i.prototype._processBindings=function(i){var r,u,f;if(this._requestType=i.requestType,this.model.query=this.commonQuery.clone(),this.model.editSettings.editMode=="batch"&&i.requestType!="batchsave"&&i.requestType!="cancel"&&!this._confirmedValue&&this._bulkChangesAcquired())return this._requestArgs=i,!1;!t.isNullOrUndefined(this.model.dataSource)&&i.requestType=="refresh"&&this.model.scrollSettings.allowVirtualScrolling&&(this._currentPage(1),this._scrollValue=0,this._loadedJsonData=[],this._prevPage=this._currentPage());this._ensureDataSource(i);this.model.scrollSettings.allowVirtualScrolling&&(i.requestType=="virtualscroll"?(this._loadedJsonData.push({pageIndex:this._prevPage,data:this._currentJsonData}),this._prevPage=this._currentPage()):this.model.scrollSettings.enableVirtualization||(this._virtualLoadedRecords[this._currentPage()]=this.model.currentViewData),i.requestType=="filtering"&&(this._loadedJsonData=[],this._prevPage=this._currentPage()));this.model.scrollSettings.allowVirtualScrolling&&i.requestType=="filtering"&&this.model.filterSettings.filteredColumns.length>0&&this.getScrollObject().scrollY(0);this.model.enableRTL?this.element.hasClass("e-rtl")||this.element.addClass("e-rtl"):this.element.hasClass("e-rtl")&&this.element.removeClass("e-rtl");i.requestType==t.HeatMapGrid.Actions.Delete&&this.model.groupSettings.groupedColumns.length==0&&(this.model.editSettings.showAddNewRow&&this.getContentTable().find(".e-addedrow").remove(),i.tr.remove());this._editForm=this.model.scrollSettings.frozenColumns>0||this.model.editSettings.showAddNewRow?this.element.find(".gridform"):n("#"+this._id+"EditForm");this.model.editSettings.showAddNewRow&&i.requestType=="beginedit"||this._editForm.length==0||this._editForm.length>1&&(i.requestType=="save"&&i.action=="edit"||i.requestType=="cancel")&&(this._editForm=this.model.editSettings.rowPosition=="top"?this._editForm[1]:this._editForm[0]);this._dataSource()instanceof t.DataManager&&!this._isRemoteSaveAdaptor&&i.requestType!=t.HeatMapGrid.Actions.BeginEdit&&i.requestType!=t.HeatMapGrid.Actions.Cancel&&i.requestType!=t.HeatMapGrid.Actions.Add?(this.model.scrollSettings.allowVirtualScrolling&&!this.model.scrollSettings.enableVirtualization&&this.model.pageSettings.totalPages==this.model.pageSettings.currentPage&&(r=t.pvt.filterQueries(this.model.query.queries,"onPage"),this.model.query.queries.splice(n.inArray(r[0],this.model.query.queries),1),this.model.query.page(this._currentPage()-1,this.model.pageSettings.pageSize),u=this._dataSource().executeQuery(this.model.query),this.model.query.queries.splice(n.inArray(r[0],this.model.query.queries),1),this.model.query.page(this._currentPage(),this.model.pageSettings.pageSize)),this._virtualSelectedRows&&this._virtualSelectedRows.length>0&&this.model.query.addParams("virtualSelectRecords",this._virtualSelectedRows),f=this._queryPromise=this._dataSource().executeQuery(this.model.query),proxy._dataSource().ready?proxy._dataSource().ready.done(function(){proxy._processDataRequest(proxy,i,f,u)}):proxy._processDataRequest(proxy,i,f,u)):this._isRelationalRendering(i)?this._setForeignKeyData(i):this.sendDataRenderingRequest(i)},i.prototype._processDataRequest=function(n,i,r,u){r.done(t.proxy(function(r){var e,f,o;if(n._relationalColumns.length==0,u&&!n._previousPageRendered)n.model.previousViewData&&n.model.previousViewData.length!=0&&(n.model.previousViewData.splice(0,r.result.length),n._previousPageLength=r.result.length,n._currentPageData=r.result,t.merge(n.model.previousViewData,r.result),n.model.currentViewData=n.model.previousViewData,n._remoteLastPageRendered=!0);else if(n._remoteLastPageRendered&&n.model.pageSettings.currentPage==n.model.pageSettings.totalPages-1&&!n.model.scrollSettings.enableVirtualization){for(e=n.model.pageSettings.pageSize-n._previousPageLength,f=0;f<e;f++)o=n.getRows()[n.getRows().length-(n.model.pageSettings.pageSize-f)],o.remove();n._tempPageRendered=!0;n.model.currentViewData=r.result}else n.model.pageSettings.currentPage!=n.model.pageSettings.totalPages-1||n._remoteLastPageRendered||(n._previousPageRendered=!0),n.model.currentViewData=r.result==null?[]:r.result,n._$fkColumn&&n.model.filterSettings.filterType=="excel"&&n.model.filterSettings.filteredColumns.length>0&&(n._fkParentTblData=r.result);n.model.allowScrolling&&n.model.scrollSettings.allowVirtualScrolling&&n.model.scrollSettings.enableVirtualization&&(i.requestType=="filtering"&&(n._gridRecordsCount=n._filteredRecordsCount=r.count,n._refreshVirtualViewDetails()),r.result.length?(n._isInitNextPage||n._isLastVirtualpage?(n._setInitialCurrentIndexRecords(r.result,n._currentPage()),n._isInitNextPage=n._isLastVirtualpage=!1):n._setVirtualLoadedRecords(r.result,n._currentPage()),n._isThumbScroll&&!n._checkCurrentVirtualView(n._virtualLoadedRecords,n._currentVirtualIndex)&&n._checkPrevNextViews(),n._remoteRefresh=!0):n.getContent().find(".e-virtualtop, .e-virtualbottom").remove());t.isNullOrUndefined(r.aggregates)||(n._remoteSummaryData=r.aggregates);t.isNullOrUndefined(n._unboundRow)||i.selectedRow==n._unboundRow||i.requestType!="save"||(n._unboundRow.find(".e-editbutton").trigger("click"),n._unboundRow=null)}));r.fail(t.proxy(function(t){i.error=t.error;t=[];n.model.currentViewData=[];n._trigger("actionFailure",i)}))},i.prototype._createUnboundElement=function(i){var f=document.createElement("div"),e,u,r,o;for(i.headerText=t.isNullOrUndefined(i.headerText)?i.field:i.headerText,t.isNullOrUndefined(i.headerText)||(f.id=this._id+i.headerText.replace(/[^a-z0-9|s_]/gi,"")+"_UnboundTemplate"),e=t.buildTag("div.e-unboundcelldiv"),u=i.commands,r=0;r<u.length;r++)o=t.buildTag("button.e-"+u[r].type.replace(/\s+/g,"")+"button","",{},{type:"button"}),o.val(u[r].type),e.append(o);return n("body").append(n(f).html(e).hide()),f},i.prototype._gridTemplate=function(n,t,i){var r=n.model.columns[i];return n._isGrouping&&(this.index=n._currentJsonData.indexOf(this.data)),n._renderEjTemplate("#"+t,this.data,this.index,r)},i.prototype._renderEjTemplate=function(i,r,u,f){var e=null;return((typeof i=="object"||i.startsWith("#")||i.startsWith("."))&&(e=n(i).attr("type")),e&&(e=e.toLowerCase(),t.template[e]))?t.template[e](this,i,r,u,f):t.template.render(this,i,r,u,f)},i.prototype._createTemplateElement=function(i,r,u){var e=i["templateID"in i?"templateID":"template"],s=/^#([\w-]*)/.exec(e),r=r||n("body"),f,h=u?"Pager":i.headerText+n.inArray(i,this.model.columns)+"_Template",o={name:"SCRIPT",type:"text/x-template",text:e,id:(this._id+h).replace(/[^0-9A-z-_]/g,"")};return f=s&&s[1]?document.getElementById(s[1]):/^<script/i.test(e)?n(e).get(0):t.buildTag(o.name,o.text).get(0),f.id=f.id||o.id,f.type=f.type||o.type,r.append(u?f.innerHTML:f),f},i.prototype._page=function(n){var t;n.events.text==this.localizedLabels.NextPage?(t=this.model.pageSettings.currentPage,++t,this.gotoPage(t)):n.events.text==this.localizedLabels.PreviousPage?(t=this.model.pageSettings.currentPage,t>1?(--t,this.gotoPage(t)):this.gotoPage(t)):n.events.text==this.localizedLabels.LastPage?(t=this.model.pageSettings.totalPages,this.gotoPage(t)):this.gotoPage(1)},i.prototype.gotoPage=function(n){var i,r,u;(this.model.allowPaging||this.model.allowScrolling||this.model.scrollSettings.allowVirtualScrolling)&&(i={},i.previousPage=this._currentPage(),this._currentPage(n),i.endIndex=this._currentPage()*this.model.pageSettings.pageSize>this._gridRecordsCount?this._gridRecordsCount:this._currentPage()*this.model.pageSettings.pageSize,i.startIndex=this._currentPage()*this.model.pageSettings.pageSize-this.model.pageSettings.pageSize,i.currentPage=n,this.model.allowPaging&&(i.requestType=t.HeatMapGrid.Actions.Paging),this.model.scrollSettings.allowVirtualScrolling&&this.model.allowScrolling&&(this._isVirtualRecordsLoaded=!1,u=this._refreshVirtualPagerInfo(),this._showPagerInformation(u),i.requestType=t.HeatMapGrid.Actions.VirtualScroll),r=this._processBindings(i),r&&this._currentPage(i.previousPage),this._primaryKeyValues=[])},i.prototype._checkScrollActions=function(n){return!this.model.scrollSettings.allowVirtualScrolling&&(n==t.HeatMapGrid.Actions.Sorting||n==t.HeatMapGrid.Actions.Reorder)||n==t.HeatMapGrid.Actions.Grouping||n==t.HeatMapGrid.Actions.Ungrouping||n==t.HeatMapGrid.Actions.Add||n==t.HeatMapGrid.Actions.Cancel||n==t.HeatMapGrid.Actions.Save||n==t.HeatMapGrid.Actions.BatchSave||n==t.HeatMapGrid.Actions.Delete||n==t.HeatMapGrid.Actions.Filtering||n==t.HeatMapGrid.Actions.Paging||n==t.HeatMapGrid.Actions.Refresh||n==t.HeatMapGrid.Actions.Search?!0:!1},i.prototype._frozenAlign=function(){var t=this.getContent().first(),i=this.getBrowserDetails(),n;n=this.model.enableRTL?"margin-right":"margin-left";t.find(".e-movablecontent").css(n,i.browser==="safari"?"auto":t.find(".e-frozencontentdiv").width()+"px");this.getHeaderContent().find(".e-movableheader").removeAttr("style").css(n,i.browser==="safari"?"auto":this.getHeaderContent().find(".e-frozenheaderdiv").width()+"px")},i.prototype._refreshScroller=function(n){var r=this.getContent().first(),i,u,f,e,o,s;t.isNullOrUndefined(r.data("ejScroller"))||(this.model.scrollSettings.frozenColumns>0&&(this._frozenAlign(),this.refreshScrollerEvent(),r.find(".e-movablecontent").scrollLeft(this.getHeaderContent().find(".e-movableheader").scrollLeft()),!t.isNullOrUndefined(this.getScrollObject()._vScrollbar)&&this.getScrollObject()._vScrollbar.value()>this.getScrollObject()._vScrollbar.model.maximum&&(i=this.getScrollObject()._vScrollbar.model.maximum)),this.model.scrollSettings.frozenRows>0&&(this._initFrozenRows(),i=this.getScrollObject().model.scrollTop,!t.isNullOrUndefined(this.getScrollObject()._vScrollbar)&&i>this.getScrollObject()._vScrollbar.model.maximum&&(i=this.getScrollObject()._vScrollbar.model.maximum),(n.requestType=="cancel"||n.requestType=="save")&&i>this._editFormHeight&&this.model.editSettings.editMode.indexOf("inlineform")!=-1&&(i=i-this._editFormHeight),n.requestType==t.Grid.Actions.Add&&this.getScrollObject().scrollY(0,!0),t.isNullOrUndefined(this.getScrollObject()._vScrollbar)||t.isNullOrUndefined(this.getScrollObject()._vScrollbar._scrollData)||(this.getScrollObject()._vScrollbar._scrollData.skipChange=!0)),n.requestType=="beginedit"&&(i=this.getScrollObject().model.scrollTop,this.getScrollObject().scrollY(0,!0)),!t.isNullOrUndefined(this.model.dataSource)&&(n.requestType=="refresh"||n.requestType=="searching")&&this.model.scrollSettings.allowVirtualScrolling&&(this.model.scrollSettings.enableVirtualization&&this._isLocalData&&this._gridRecordsCount>0?this._refreshVirtualView(this._currentVirtualIndex):this._refreshVirtualContent(1),this._currentVirtualIndex==1&&this.getScrollObject().scrollY(0)),this.model.scrollSettings.frozenColumns>0&&n.requestType!="filtering"?this.rowHeightRefresh():this.getScrollObject().refresh(),r.ejScroller("model.enableRTL",thi