/*!@license * Infragistics.Web.ClientUI Grid 19.1.20 * * Copyright (c) 2011-2019 Infragistics Inc. * * http://www.infragistics.com/ * * Depends on: * jquery-1.9.1.js * jquery.ui.core.js * jquery.ui.widget.js * infragistics.dataSource.js * infragistics.ui.widget.js * infragistics.ui.shared.js * infragistics.templating.js * infragistics.util.js */ (function(factory){if(typeof define==="function"&&define.amd){define(["./infragistics.ui.widget","./infragistics.datasource","./infragistics.templating","./i18n/regional/infragistics.ui.regional-en","./infragistics.ui.shared","./infragistics.ui.scroll"],factory)}else{return factory(jQuery)}})(function($){/*!@license * Infragistics.Web.ClientUI Grid localization resources 19.1.20 * * Copyright (c) 2011-2019 Infragistics Inc. * * http://www.infragistics.com/ * */ (function($){$.ig=$.ig||{};$.ig.locale=$.ig.locale||{};$.ig.locale.en=$.ig.locale.en||{};$.ig.Grid=$.ig.Grid||{};$.ig.locale.en.Grid={noSuchWidget:"{featureName} was not recognized. Verify that such a feature exists and the spelling is correct.",autoGenerateColumnsNoRecords:"autoGenerateColumns is enabled, but there are no records in the data source. Load a data source with records to be able to determine the columns.",optionChangeNotSupported:"{optionName} cannot be edited after initialization. Its value should be set during initialization.",optionChangeNotScrollingGrid:"{optionName} cannot be edited after initialization because your grid initially does not scroll and full re-rendering will be required. This option should be set during initialization.",widthChangeFromPixelsToPercentagesNotSupported:"Cannot change dynamically option width of the grid from pixels to percentages.",widthChangeFromPercentagesToPixelsNotSupported:"Cannot change dynamically option width of the grid from percentages to pixels.",noPrimaryKeyDefined:"There is no primary key defined for the grid. Define a primary key in order to use features such as Grid Editing.",indexOutOfRange:"The specified row index is out of range. A row index between 0 and {max} should be provided.",noSuchColumnDefined:"The specified column key is not valid. A column key that matches the key of one of the defined grid columns should be provided.",columnIndexOutOfRange:"The specified column index is out of range. A column index between 0 and {max} should be provided.",recordNotFound:"A record with id {id} could not be found in the data view. Verify the id used for the search and adjust it if necessary.",columnNotFound:"A column with key {key} could not be found. Verify the key used for the search and adjust it if necessary.",colPrefix:"Column ",columnVirtualizationRequiresWidth:"Virtualization and columnVirtualization require the width of the grid or its columns to be set. Provide a value for the grid width, defaultColumnWidth or the width of each column.",virtualizationRequiresHeight:"Virtualization requires the height of the grid to be set. A value for the grid height should be provided.",colVirtualizationDenied:"columnVirtualization requires a different virtualizationMode setting. The virtualizationMode should be set to 'fixed'.",noColumnsButAutoGenerateTrue:"autoGenerateColumns is disabled and no columns are defined for the grid. Either enable autoGenerateColumns or manually specify the columns.",expandTooltip:"Expand Row",collapseTooltip:"Collapse Row",movingNotAllowedOrIncompatible:"The specified column could not be moved. Verify that such a column exists and its end position would not break the column layout.",allColumnsHiddenOnInitialization:"All columns cannot be hidden during initialization. At least one column should be configured as visible.",virtualizationNotSupportedWithAutoSizeCols:"Virtualization requires a different column width configuration than '*'. The column width should be set as a number in pixels.",columnVirtualizationNotSupportedWithPercentageWidth:"Column virtualization requires a different grid width configuration. The column width should be set as a number in pixels.",mixedWidthsNotSupported:"All columns are required to have their width set the same way. Set all column widths either as percentages or as number in pixels.",multiRowLayoutColumnError:"The column with key: {key1} could not be added to Multi-Row Layout because its place in the layout has already been taken by the column with key: {key2} .",multiRowLayoutNotComplete:"The Multi-Row Layout is not complete. The column definition creates a layout that has empty spaces and cannot be rendered correctly.",multiRowLayoutMixedWidths:"Mixed widths (percentage and pixels) are not supported in the Multi-Row Layout. Please define all column widths in either pixels or percentage. ",multiRowLayoutHidingNotSupported:"The Multi-Row Layout does not support hidden columns. Please remove hidden columns from the column definitions.",scrollableGridAreaNotVisible:"Fixed header and footer areas are larger than the available grid height. The scrollable area is not visible.Please set a larger grid height.",featureNotSupportedWithMRL:"{featureName} is not supported with Multi-Row Layout. Please remove the feature from the features' list.",editorTypeCannotBeDetermined:"Updating did not have enough information to properly determine the type of editor to use for column: "};$.ig.HierarchicalGrid=$.ig.HierarchicalGrid||{};$.ig.locale.en.HierarchicalGrid={noPrimaryKey:"igHierarchicalGrid requires a primary key to be defined. A primary key should be provided.",expandTooltip:"Expand Row",collapseTooltip:"Collapse Row"};$.ig.GridFeatureChooser=$.ig.GridFeatureChooser||{};$.ig.locale.en.GridFeatureChooser={featureChooserTooltip:"Feature chooser"};$.ig.GridFiltering=$.ig.GridFiltering||{};$.ig.locale.en.GridFiltering={optionChangeNotSupported:"{optionName} cannot be edited after initialization. Its value should be set during initialization.",startsWithNullText:"Starts with...",endsWithNullText:"Ends with...",containsNullText:"Contains...",doesNotContainNullText:"Does not contain...",equalsNullText:"Equals...",doesNotEqualNullText:"Does not equal...",greaterThanNullText:"Greater than...",lessThanNullText:"Less than...",greaterThanOrEqualToNullText:"Greater than or equal to...",lessThanOrEqualToNullText:"Less than or equal to...",onNullText:"On...",notOnNullText:"Not on...",afterNullText:"After",beforeNullText:"Before",emptyNullText:"Empty",notEmptyNullText:"Not empty",nullNullText:"Null",notNullNullText:"Not null",emptyLabel:"Empty",notEmptyLabel:"Not empty",nullLabel:"Null",notNullLabel:"Not null",startsWithLabel:"Starts with",endsWithLabel:"Ends with",containsLabel:"Contains",doesNotContainLabel:"Does not contain",equalsLabel:"Equals",doesNotEqualLabel:"Does not equal",greaterThanLabel:"Greater than",lessThanLabel:"Less than",greaterThanOrEqualToLabel:"Greater than or equal to",lessThanOrEqualToLabel:"Less than or equal to",trueLabel:"True",falseLabel:"False",afterLabel:"After",beforeLabel:"Before",todayLabel:"Today",yesterdayLabel:"Yesterday",thisMonthLabel:"This month",lastMonthLabel:"Last month",nextMonthLabel:"Next month",thisYearLabel:"This year",lastYearLabel:"Last year",nextYearLabel:"Next year",atLabel:"At",atNullText:"At...",notAtLabel:"Not at",notAtNullText:"Not at...",atBeforeLabel:"At or before",atBeforeNullText:"At or before...",atAfterLabel:"At or after",atAfterNullText:"At or after...",clearLabel:"Clear Filter",noFilterLabel:"No",onLabel:"On",notOnLabel:"Not on",advancedButtonLabel:"Advanced",filterDialogCaptionLabel:"ADVANCED FILTER",filterDialogConditionLabel1:"Show records matching ",filterDialogConditionLabel2:" of the following criteria",filterDialogConditionDropDownLabel:"Filtering condition",filterDialogOkLabel:"Search",filterDialogCancelLabel:"Cancel",filterDialogAnyLabel:"ANY",filterDialogAllLabel:"ALL",filterDialogAddLabel:"Add",filterDialogErrorLabel:"You reached the maximum number of filters supported.",filterDialogCloseLabel:"Close filtering dialog",filterSummaryTitleLabel:"Search results",filterSummaryTemplate:"${matches} matching records",filterDialogClearAllLabel:"Clear ALL",tooltipTemplate:"${condition} filter applied",featureChooserText:"Hide Filter",featureChooserTextHide:"Show Filter",featureChooserTextAdvancedFilter:"Advanced Filter",virtualizationSimpleFilteringNotAllowed:"Column virtualization requires a different type of filtering. Set filtering mode to 'advanced' or disable advancedModeEditorsVisible",multiRowLayoutSimpleFilteringNotAllowed:"Multi-Row Layout requires a different type of filtering. Set filtering mode to 'advanced'",featureChooserNotReferenced:"A reference to Feature Chooser is missing. Include infragistics.ui.grid.featurechooser.js in your project, use a loader or one of the combined script files.",conditionListLengthCannotBeZero:"The conditionList array in columnSettings is empty. A suitable array for the conditionList should be provided.",conditionNotValidForColumnType:"The condition '{0}' is not valid for the current configuration. It should be replaced with a condition suitable for {1} column type.",defaultConditionContainsInvalidCondition:"defaultExpression for the '{0}' column contains a condition that is not allowed. It should be replaced it with a condition suitable for {0} column type.",initialConditionIsNotInTheConditionsListArrayOrIsNotInTheDefaultConditions:"The initial condition set in the columnSettings for column '{0}' is not from the default(or custom conditions) or is not avaliable in the conditionList array set in columnSettins.Please apply a valid condition."};$.ig.GridGroupBy=$.ig.GridGroupBy||{};$.ig.locale.en.GridGroupBy={optionChangeNotSupported:"{optionName} cannot be edited after initialization. Its value should be set during initialization.",emptyGroupByAreaContent:"Drag a column here or {0} to Group By",emptyGroupByAreaContentSelectColumns:"select columns",emptyGroupByAreaContentSelectColumnsCaption:"select columns",expandTooltip:"Expand Grouped Row",collapseTooltip:"Collapse Grouped Row",removeButtonTooltip:"Remove Grouped Column",modalDialogCaptionButtonDesc:"Sort ascending",modalDialogCaptionButtonAsc:"Sort descending",modalDialogCaptionButtonUngroup:"Ungroup",modalDialogGroupByButtonText:"Group By",modalDialogCaptionText:"Add to Group By",modalDialogDropDownLabel:"Showing:",modalDialogClearAllButtonLabel:"Clear ALL",modalDialogRootLevelHierarchicalGrid:"Root",modalDialogDropDownButtonCaption:"Show/Hide",modalDialogButtonApplyText:"Apply",modalDialogButtonCancelText:"Cancel",fixedVirualizationNotSupported:"Group By requires another virtualization setting. The virtualizationMode should be set to 'continuous'.",summaryRowTitle:"Grouping summary row",summaryIconTitle:"Summary for {0}: {1}"};$.ig.GridHiding=$.ig.GridHiding||{};$.ig.locale.en.GridHiding={optionChangeNotSupported:"{optionName} cannot be edited after initialization. Its value should be set during initialization.",columnChooserDisplayText:"Column Chooser",hiddenColumnIndicatorTooltipText:"Hidden Column(s)",columnHideText:"Hide",columnChooserCaptionLabel:"Column Chooser",columnChooserCloseButtonTooltip:"Close",hideColumnIconTooltip:"Hide",featureChooserNotReferenced:"A reference to Feature Chooser is missing. Include infragistics.ui.grid.featurechooser.js in your project or use one of the combined script files.",columnChooserShowText:"Show",columnChooserHideText:"Hide",columnChooserResetButtonLabel:"Reset",columnChooserButtonApplyText:"Apply",columnChooserButtonCancelText:"Cancel"};$.ig.GridResizing=$.ig.GridResizing||{};$.ig.locale.en.GridResizing={optionChangeNotSupported:"{optionName} cannot be edited after initialization. Its value should be set during initialization.",noSuchVisibleColumn:"There is no visible column for the specified key. The showColumn() method should be used on the column before trying to resize it.",resizingAndFixedVirtualizationNotSupported:"Resizing columns requires a different virtualization setting. Use rowVirtualization and set the virtualizationMode to 'continuous'."};$.ig.GridPaging=$.ig.GridPaging||{};$.ig.locale.en.GridPaging={optionChangeNotSupported:"{optionName} cannot be edited after initialization. Its value should be set during initialization.",pageSizeDropDownLabel:"Show ",pageSizeDropDownTrailingLabel:"records",nextPageLabelText:"Next",prevPageLabelText:"Prev",firstPageLabelText:"",lastPageLabelText:"",currentPageDropDownLeadingLabel:"Pg",currentPageDropDownTrailingLabel:"of ${count}",currentPageDropDownTooltip:"Choose page index",pageSizeDropDownTooltip:"Choose number of records per page",pagerRecordsLabelTooltip:"Current records range",prevPageTooltip:"Previous page",nextPageTooltip:"Next page",firstPageTooltip:"First page",lastPageTooltip:"Last page",pageTooltipFormat:"Page ${index}",pagerRecordsLabelTemplate:"${startRecord} - ${endRecord} of ${recordCount} records",invalidPageIndex:"The specified page index is not valid. Provide a page index that is greater than or equal to 0 and less than the total number of pages."};$.ig.GridSelection=$.ig.GridSelection||{};$.ig.locale.en.GridSelection={optionChangeNotSupported:"{optionName} cannot be edited after initialization. Its value should be set during initialization.",persistenceImpossible:"Persisting selection requires a different configuration. The primary key option of the grid should be configured."};$.ig.GridRowSelectors=$.ig.GridRowSelectors||{};$.ig.locale.en.GridRowSelectors={optionChangeNotSupported:"{optionName} cannot be edited after initialization. Its value should be set during initialization.",selectionNotLoaded:"igGridSelection has not been initialized. Selection should be enabled for the grid.",columnVirtualizationEnabled:"Row Selectors require a different virtualization setting. Use rowVirtualization or set the virtualizationMode to 'continuous'.",selectedRecordsText:"You have selected ${checked} records.",deselectedRecordsText:"You have deselected ${unchecked} records.",selectAllText:"Select all ${totalRecordsCount} records",deselectAllText:"Deselect all ${totalRecordsCount} records",requireSelectionWithCheckboxes:"Selection is required when there are checkboxes enabled"};$.ig.GridSorting=$.ig.GridSorting||{};$.ig.locale.en.GridSorting={optionChangeNotSupported:"{optionName} cannot be edited after initialization. Its value should be set during initialization.",sortedColumnTooltip:"Sorted ${direction}",unsortedColumnTooltip:"Sort column",ascending:"ascending",descending:"descending",modalDialogSortByButtonText:"Sort by",modalDialogResetButton:"Reset",modalDialogCaptionButtonDesc:"Click to sort descending",modalDialogCaptionButtonAsc:"Click to sort ascending",modalDialogCaptionButtonUnsort:"Click to remove sorting",featureChooserText:"Sort on Multiple",modalDialogCaptionText:"Sort on Multiple",modalDialogButtonApplyText:"Apply",modalDialogButtonCancelText:"Cancel",sortingHiddenColumnNotSupport:"The specified column could not be sorted because it is hidden. Use the showColumn() method on it before trying to sort it.",featureChooserSortAsc:"Sort ascending",featureChooserSortDesc:"Sort descending"};$.ig.GridSummaries=$.ig.GridSummaries||{};$.ig.locale.en.GridSummaries={optionChangeNotSupported:"{optionName} cannot be edited after initialization. Its value should be set during initialization.",featureChooserText:"Hide Summaries",featureChooserTextHide:"Show Summaries",dialogButtonOKText:"OK",dialogButtonCancelText:"Cancel",emptyCellText:"",summariesHeaderButtonTooltip:"Show/Hide summaries",defaultSummaryRowDisplayLabelCount:"Count",defaultSummaryRowDisplayLabelMin:"Min",defaultSummaryRowDisplayLabelMax:"Max",defaultSummaryRowDisplayLabelSum:"Sum",defaultSummaryRowDisplayLabelAvg:"Avg",defaultSummaryRowDisplayLabelCustom:"Custom",calculateSummaryColumnKeyNotSpecified:"Column key is missing. A column key should be specified to calculate summaries.",featureChooserNotReferenced:"A reference to Feature Chooser is missing. Include infragistics.ui.grid.featurechooser.js in your project or use one of the combined script files."};$.ig.GridUpdating=$.ig.GridUpdating||{};$.ig.locale.en.GridUpdating={optionChangeNotSupported:"{optionName} cannot be edited after initialization. Its value should be set during initialization.",doneLabel:"Done",doneTooltip:"Stop editing and update",cancelLabel:"Cancel",cancelTooltip:"Stop editing without updating",addRowLabel:"Add new row",addRowTooltip:"Start adding a new row",deleteRowLabel:"Delete row",deleteRowTooltip:"Delete row",igTextEditorException:"It is currently not possible to update string columns in the grid. ui.igTextEditor should be loaded first.",igNumericEditorException:"It is currently not possible to update numeric columns in the grid. ui.igNumericEditor should be loaded first.",igCheckboxEditorException:"It is currently not possible to update checkbox columns in the grid. ui.igCheckboxEditor should be loaded first.",igCurrencyEditorException:"It is currently not possible to update numeric columns with currency format in the grid. ui.igCurrencyEditor should be loaded first.",igPercentEditorException:"It is currently not possible to update numeric columns with percent format in the grid. ui.igPercentEditor should be loaded first.",igDateEditorException:"It is currently not possible to update date columns in the grid. ui.igDateEditor should be loaded first.",igDatePickerException:"It is currently not possible to update date columns in the grid. ui.igDatePicker should be loaded first.",igTimePickerException:"It is currently not possible to update date columns in the grid. ui.igTimePicker should be loaded first.",igComboException:"It is currently not possible to use a combo in the grid. ui.igCombo should be loaded first.",igRatingException:"It is currently not possible to use igRating as an editor in the grid. ui.igRating should be loaded first.",igValidatorException:"It is currently not possible to support validation with the options defined in igGridUpdating. ui.igValidator should be loaded first.",noPrimaryKeyException:"In order to support update operations after a row was deleted, application should define primaryKey in options of igGrid.",hiddenColumnValidationException:"Cannot edit row which has a hidden column with enabled validation.",dataDirtyException:"Grid has pending transactions which may affect rendering of data. To prevent exception, application may enable autoCommit option of igGrid, or it should process dataDirty event of igGridUpdating and return false. While processing that event, application also may do commit() data in igGrid.",recordOrPropertyNotFoundException:"The specified record or property was not found. Verify the criteria for your search and adjust them if necessary.",rowUpdatingNotSupportedWithColumnVirtualization:'Updating with editMode: "row" requires different configuration. columnVirtualization should be disabled.',rowEditDialogCaptionLabel:"Edit row data",excelNavigationNotSupportedWithCurrentEditMode:"Excel Navigation requires a different configuration. editMode should be set to 'cell' or 'row'",columnNotFound:"The specified column key was not found in the visible columns' collection or the specified index was out of range.",rowOrColumnSpecifiedOutOfView:"Editing the specified row or column is currently not possible. It should be in view on the current page and virtualization frame.",editingInProgress:"A row or cell is currently being edited. Another updating procedure cannot start before the current editing is finished.",undefinedCellValue:"Undefined cannot be set as a cell value.",addChildTooltip:"Add a child row",multiRowGridNotSupportedWithCurrentEditMode:"When the grid has Multi-Row Layout enabled only dialog edit mode is supported.",virtualizationNotSupportedWithoutAutoCommit:" Enabling Updating and Virtualization while autoCommit is set to false is not supported. Please set the grid's autoCommit option to true."};$.ig.CellMerging=$.ig.CellMerging||{};$.ig.locale.en.CellMerging={optionChangeNotSupported:"{optionName} cannot be edited after initialization. Its value should be set during initialization.",mergeStrategyNotAFunction:"The mergeStrategy specified is not recognized as a valid pre-defined value or a function with this name is not found."};$.ig.ColumnMoving=$.ig.ColumnMoving||{};$.ig.locale.en.ColumnMoving={optionChangeNotSupported:"{optionName} cannot be edited after initialization. Its value should be set during initialization.",movingDialogButtonApplyText:"Apply",movingDialogButtonCancelText:"Cancel",movingDialogCaptionButtonDesc:"Move down",movingDialogCaptionButtonAsc:"Move up",movingDialogCaptionText:"Move Columns",movingDialogDisplayText:"Move Columns",movingDialogDropTooltipText:"Move here",movingDialogCloseButtonTitle:"Close moving dialog",dropDownMoveLeftText:"Move left",dropDownMoveRightText:"Move right",dropDownMoveFirstText:"Move first",dropDownMoveLastText:"Move last",featureChooserNotReferenced:"A reference to Feature Chooser is missing. Include infragistics.ui.grid.featurechooser.js in your project or use one of the combined script files.",movingToolTipMove:"Move",featureChooserSubmenuText:"Move To",columnVirtualizationEnabled:"Column Moving requires a different virtualization setting. Use rowVirtualization or set the virtualizationMode to 'continuous'."};$.ig.ColumnFixing=$.ig.ColumnFixing||{};$.ig.locale.en.ColumnFixing={optionChangeNotSupported:"{optionName} cannot be edited after initialization. Its value should be set during initialization.",headerFixButtonText:"Fix this column",headerUnfixButtonText:"Unfix this column",featureChooserTextFixedColumn:"Fix column",featureChooserTextUnfixedColumn:"Unfix column",groupByNotSupported:"Column Fixing requires a different configuration. The Group By functionality should be disabled.",virtualizationNotSupported:"Column Fixing requires a different virtualization setting. rowVirtualization should be used instead.",columnVirtualizationNotSupported:"Column Fixing requires a different virtualization setting. columnVirtualization should be disabled.",columnMovingNotSupported:"Column Fixing requires a different configuration. Column Moving should be disabled.",hidingNotSupported:"Column Fixing requires a different configuration. The Hiding functionality should be disabled.",hierarchicalGridNotSupported:"igHierarchicalGrid does not support Column Fixing. Column Fixing should be disabled.",responsiveNotSupported:"Column Fixing requires a different configuration. The Responsive functionality should be disabled.",noGridWidthNotSupported:"Column Fixing requires a different configuration. The grid width should be set either as percentages or as number in pixels.",gridHeightInPercentageNotSupported:"Column Fixing requires a different configuration. The grid height should be set in pixels.",defaultColumnWidthInPercentageNotSupported:"Column Fixing requires a different configuration. The default column width should be set as a number in pixels.",columnsWidthShouldBeSetInPixels:"Column Fixing requires a different column width setting. The width of column with key {key} should be set in pixels.",unboundColumnsNotSupported:"Column Fixing requires a different configuration. Unbound Columns should be disabled.",excelNavigationNotSupportedWithCurrentEditMode:"Excel Navigation requires a different configuration. editMode should be set to 'cell' or 'row'.",initialFixingNotApplied:"Initial fixing could not be applied for column with key: {0}. Reason: {1}",setOptionGridWidthException:"Incorrect value for option grid width. When there are fixed columns width of the visible area of unfixed column(s) should be greater that or equal to value of minimalVisibleAreaWidth.",noneError:"Your grid configuration is successful!",notValidIdentifierError:"The specified column key is not valid. Provide a column key that matches the key of one of the defined grid columns.",fixingRefusedError:"Fixing this column is not currently supported. Unfix another visible column or use the showColumn() method on any hidden unfixed column first.",fixingRefusedMinVisibleAreaWidthError:"This column cannot be fixed. Its width exceeds the available space for fixing a column in the grid.",alreadyHiddenError:"Fixing/Unfixing this column is currently not possible. The showColumn() method should be used on the column first.",alreadyUnfixedError:"This column is already unfixed.",alreadyFixedError:"This column is already fixed.",unfixingRefusedError:"Unfixing this column is currently not possible. The showColumn() method should be used on any hidden fixed column first.",targetNotFoundError:"Target column with key {key} could not be found. Verify the key used for the search and adjust it if necessary."};$.ig.GridAppendRowsOnDemand=$.ig.GridAppendRowsOnDemand||{};$.ig.locale.en.GridAppendRowsOnDemand={optionChangeNotSupported:"{optionName} cannot be edited after initialization. Its value should be set during initialization.",loadMoreDataButtonText:"Load more data",appendRowsOnDemandRequiresHeight:"Append Rows On Demand requires a different configuration. The grid height should be set.",groupByNotSupported:"Append Rows On Demand requires a different configuration. Group By should be disabled.",pagingNotSupported:"Append Rows On Demand requires a different configuration. Paging should be disabled.",cellMergingNotSupported:"Append Rows On Demand requires a different configuration. Cell Merging should be disabled.",virtualizationNotSupported:"Append Rows On Demand requires a different configuration. Virtualization should be disabled."};$.ig.igGridResponsive=$.ig.igGridResponsive||{};$.ig.locale.en.igGridResponsive={optionChangeNotSupported:"{optionName} cannot be edited after initialization. Its value should be set during initialization.",fixedVirualizationNotSupported:'The Responsive functionality requires a different virtualization setting. virtualizationMode should be set to "continuous".'};$.ig.igGridMultiColumnHeaders=$.ig.igGridMultiColumnHeaders||{};$.ig.locale.en.igGridMultiColumnHeaders={optionChangeNotSupported:"{optionName} cannot be edited after initialization. Its value should be set during initialization.",multiColumnHeadersNotSupportedWithColumnVirtualization:"Multi-column headers require a different configuration. columnVirtualization should be disabled.",cannotExpandMultiColumnHeader:"Multi-Column header exceeds the maximum allowed fixed area width and therefore cannot be expanded",atLeastOneColumnShouldBeShownWhenCollapseOrExpand:"You should have at least one column shown when you expand or collapse a multi-column header.",collapsedColumnIconTooltip:"Expand",expandedColumnIconTooltip:"Collapse"};$.ig.Grid.locale=$.ig.Grid.locale||$.ig.locale.en.Grid;$.ig.GridFiltering.locale=$.ig.GridFiltering.locale||$.ig.locale.en.GridFiltering;$.ig.GridGroupBy.locale=$.ig.GridGroupBy.locale||$.ig.locale.en.GridGroupBy;$.ig.GridHiding.locale=$.ig.GridHiding.locale||$.ig.locale.en.GridHiding;$.ig.GridResizing.locale=$.ig.GridResizing.locale||$.ig.locale.en.GridResizing;$.ig.GridPaging.locale=$.ig.GridPaging.locale||$.ig.locale.en.GridPaging;$.ig.GridSelection.locale=$.ig.GridSelection.locale||$.ig.locale.en.GridSelection;$.ig.GridRowSelectors.locale=$.ig.GridRowSelectors.locale||$.ig.locale.en.GridRowSelectors;$.ig.GridSorting.locale=$.ig.GridSorting.locale||$.ig.locale.en.GridSorting;$.ig.GridSummaries.locale=$.ig.GridSummaries.locale||$.ig.locale.en.GridSummaries;$.ig.GridUpdating.locale=$.ig.GridUpdating.locale||$.ig.locale.en.GridUpdating;$.ig.CellMerging.locale=$.ig.CellMerging.locale||$.ig.locale.en.CellMerging;$.ig.ColumnMoving.locale=$.ig.ColumnMoving.locale||$.ig.locale.en.ColumnMoving;$.ig.ColumnFixing.locale=$.ig.ColumnFixing.locale||$.ig.locale.en.ColumnFixing;$.ig.GridAppendRowsOnDemand.locale=$.ig.GridAppendRowsOnDemand.locale||$.ig.locale.en.GridAppendRowsOnDemand;$.ig.igGridResponsive.locale=$.ig.igGridResponsive.locale||$.ig.locale.en.igGridResponsive;$.ig.igGridMultiColumnHeaders.locale=$.ig.igGridMultiColumnHeaders.locale||$.ig.locale.en.igGridMultiColumnHeaders;$.ig.HierarchicalGrid.locale=$.ig.HierarchicalGrid.locale||$.ig.locale.en.HierarchicalGrid;return $.ig.locale.en})($);var _hovTR,_aNull=function(val){return val===null||val===undefined};$.widget("ui.igGrid",$.ui.igWidget,{css:{baseClass:"ui-widget ui-helper-clearfix ui-corner-all",baseContentClass:"ui-widget-content",gridClasses:"ui-iggrid",recordClass:"ui-ig-record ui-iggrid-record",recordAltClass:"ui-ig-altrecord ui-iggrid-altrecord",headerClass:"ui-iggrid-header ui-widget-header",headerTextClass:"ui-iggrid-headertext",headerCellFeatureEnabledClass:"ui-iggrid-headercell-featureenabled",baseHeaderClass:"ui-widget-header",gridTableClass:"ui-iggrid-table ui-widget-content",mrlGridTableClass:"ui-iggrid-table-mrl ui-widget-content",mrlGridHeaderScrollableTableClass:"ui-iggrid-headertable-mrl-scrollable",gridHeaderTableClass:"ui-iggrid-headertable",mrlGridHeaderTableClass:"ui-iggrid-headertable-mrl",gridFooterTableClass:"ui-iggrid-footertable ui-widget-footer",gridFooterClass:"",gridHeaderCaptionClass:"ui-iggrid-headercaption ui-widget-header ui-corner-top",gridTableBodyClass:"ui-iggrid-tablebody",gridScrollDivClass:"ui-iggrid-scrolldiv ui-widget-content",gridVirtualScrollDivClass:"ui-iggrid-virtualscrolldiv",deletedRecord:"ui-iggrid-deletedrecord",modifiedRecord:"ui-iggrid-modifiedrecord",rtl:"ui-iggrid-rtl",gridScrollbarsWrapper:"iggrid-scrollbars-wrapper",gridMeasurementContainerClass:"ui-iggrid-measurement-container"},options:{locale:null,width:null,height:null,autoAdjustHeight:true,avgRowHeight:25,avgColumnWidth:null,defaultColumnWidth:null,autoGenerateColumns:true,virtualization:false,virtualizationMode:"fixed",rowVirtualization:false,columnVirtualization:false,virtualizationMouseWheelStep:null,adjustVirtualHeights:false,templatingEngine:"infragistics",columns:[{headerText:null,key:null,formatter:null,format:null,dataType:"string",width:null,hidden:false,template:null,unbound:false,groupOptions:{expanded:true,allowGroupCollapsing:false,hidden:"never"},group:[],dateDisplayType:"local",rowspan:0,formula:null,unboundValues:null,headerCssClass:null,columnCssClass:null,mapper:null,rowIndex:null,columnIndex:null,navigationIndex:null,colSpan:1,rowSpan:1}],dataSource:null,dataSourceUrl:null,dataSourceType:null,responseDataKey:null,responseTotalRecCountKey:null,requestType:"GET",responseContentType:"application/json; charset=utf-8",showHeader:true,showFooter:true,fixedHeaders:true,fixedFooters:true,caption:null,features:[{name:null}],tabIndex:0,localSchemaTransform:true,primaryKey:null,serializeTransactionLog:true,autoCommit:false,aggregateTransactions:false,autoFormat:"date",renderCheckboxes:false,updateUrl:null,restSettings:{create:{url:null,template:null,batch:false},update:{url:null,template:null,batch:false},remove:{url:null,template:null,batch:false},encodeRemoveInRequestUri:true,contentSerializer:null,contentType:"application/json; charset=utf-8"},alternateRowStyles:true,autofitLastColumn:true,enableHoverStyles:true,enableUTCDates:false,mergeUnboundColumns:false,jsonpRequest:false,enableResizeContainerCheck:true,featureChooserIconDisplay:"desktopOnly",scrollSettings:{scrollTop:0,scrollLeft:0,wheelStep:50,smoothing:false,smoothingStep:1,smoothingDuration:1,inertiaStep:1,inertiaDuration:1}},events:{cellClick:"cellClick",cellRightClick:"cellRightClick",dataBinding:"dataBinding",dataBound:"dataBound",rendering:"rendering",rendered:"rendered",dataRendering:"dataRendering",dataRendered:"dataRendered",headerRendering:"headerRendering",headerRendered:"headerRendered",captionRendering:"captionRendering",captionRendered:"captionRendered",footerRendering:"footerRendering",footerRendered:"footerRendered",headerCellRendered:"headerCellRendered",rowsRendering:"rowsRendering",rowsRendered:"rowsRendered",schemaGenerated:"schemaGenerated",columnsCollectionModified:"columnsCollectionModified",requestError:"requestError",created:"igcontrolcreated",destroyed:"igcontroldestroyed"},resizeTimeout:300,maxScrollContainerHeight:10737418,cloneChildElements:false,widget:function(){return this.element},_persistVirtualScrollTop:false,_createWidget:function(options){var cols;this.options.columns=null;this.options.features=null;if(options){if(options.dataSource&&($.type(options.dataSource)==="array"||$.type(options.dataSource)==="object")){this.tmpDataSource=options.dataSource;options.dataSource=null;this._originalOptions=options}if(options.autoGenerateColumns===undefined){cols=options.columns;if($.type(cols)==="array"&&cols.length){options.autoGenerateColumns=false}}}this._superApply(arguments)},_execSetOptionCallbacks:function(key,value){var callbacks=this._setOptionCallbacks||[],i,len=callbacks.length;for(i=0;itr")}if(show){header.show();fHeader.show()}else{header.hide();fHeader.hide()}},_setOptionsForFeatures:function(options){var i,f,features=this.options.features,featureInstance,fc;for(i=0;itbody>tr[data-row-idx]").last();endIndex=$tr.attr("data-row-idx");endIndex=parseInt(endIndex,10)}else{endIndex=this._startRowIndex+this.element.find(">tbody>tr").length-1}if(!endIndex){return[]}dataView=dataView.slice(this._startRowIndex,endIndex+1)}dataView=dataView.filter(function(record){return!record.__gbRecord&&!record.__gbSummaryRecord});return dataView},changeRegional:function(){var dataRecords=this._getRenderedDataRecords();if(!dataRecords.length){return}this._setOptionsForFeatures({regional:this.options.regional});this._getAllFormattedColumns().forEach(function(column){this._renderColumnData(column.key,dataRecords)},this)},_changeLanguage:function(language){this.options.language=language;this._setOptionsForFeatures({language:language})},_setOption:function(key,value){var isScrolling,caption,tmp,cval,t=$.type(value),hasVirtualization=this.options.virtualization||this.options.rowVirtualization||this.options.columnVirtualization;if(value===this.options[key]&&t!=="array"&&t!=="object"){return}cval=this.options[key];isScrolling=this.options.height!==null||this.options.width!==null;if(key==="columns"){this.renderMultiColumnHeader(value);return}else if(key==="scrollSettings"){value=$.extend(this.options.scrollSettings,value)}if(key==="language"){this._changeLanguage(value);return this}this._super(key,value);if(key==="virtualization"||key==="autoGenerateColumns"||key==="rowVirtualization"||key==="columnVirtualization"||key==="fixedHeaders"||key==="scrollbars"){throw new Error(this._getLocaleValue("optionChangeNotSupported").replace("{optionName}",key))}this._execSetOptionCallbacks(key,value);if(key==="width"){if(isScrolling===true){if(typeof cval==="string"&&cval.indexOf("%")!==-1&&this._gridHasWidthInPixels()){throw new Error(this._getLocaleValue("widthChangeFromPercentagesToPixelsNotSupported"))}else if(!(typeof cval==="string"&&cval.indexOf("%")!==-1)&&this._gridHasWidthInPercent()){throw new Error(this._getLocaleValue("widthChangeFromPixelsToPercentagesNotSupported"))}this._setGridWidth(value);this._fireInternalEvent("_gridWidthChanged");if((this.options.virtualization===true||this.options.rowVirtualization===true||this.options.columnVirtualization)&&this._vdisplaycontainer().data("igScroll")&&typeof this._vdisplaycontainer().data("igScroll")._onElementMutation==="function"){this._vdisplaycontainer().data("igScroll")._onElementMutation([{attributeName:"style"}])}else if(this.scrollContainer().data("igScroll")&&typeof this.scrollContainer().data("igScroll")._onElementMutation==="function"){this.scrollContainer().data("igScroll")._onElementMutation([{attributeName:"style"}])}}else{throw new Error(this._getLocaleValue("optionChangeNotScrollingGrid").replace("{optionName}",key))}}else if(key==="height"){if(isScrolling===true){this.scrollContainer().css("overflow-y","auto");if(this.options.autoAdjustHeight){this.container().css("height",value);this._virtualHeightReset=true;if(hasVirtualization&&this.options.virtualizationMode!=="fixed"){this._saveFirstVisibleTRIndex()}this._initializeHeights()}else{if(this.options.virtualization===true||this.options.columnVirtualization===true||this.options.rowVirtualization===true){this._vdisplaycontainer().css("height",value);this._scrollContainer().css("height",value);this.element.height(value)}else{this.scrollContainer().css("height",value)}}if(hasVirtualization){if(this.options.virtualizationMode==="fixed"){this._buildVirtualDom();this.virtualScrollTo(this._startRowIndex)}else{tmp=this._persistVirtualScrollTop;this._persistVirtualScrollTop=true;this._renderVirtualRecords();this._persistVirtualScrollTop=tmp}}this._fireInternalEvent("_heightChanged")}else{throw new Error(this._getLocaleValue("optionChangeNotScrollingGrid").replace("{optionName}",key))}}else if(key==="dataSource"){this.options.dataSource=value;this.dataBind();if(this._inferOpType()!=="remote"){this.autoSizeColumns()}}else if(key==="showHeader"){this._showHideHeader(value)}else if(key==="caption"){caption=this._caption();if(caption.length===0){this._renderCaption();if(this.options.autoAdjustHeight){this._initializeHeights()}}else{caption.html(value)}}else if(key==="alternateRowStyles"){this._renderData()}else if(key==="scrollSettings"){if(this.options.virtualization===true||this.options.rowVirtualization===true||this.options.columnVirtualization){this._vdisplaycontainer().igScroll("option",value)}else{this.scrollContainer().igScroll("option",value)}}},_initialized:false,_headersInitialized:false,_footerInitialized:false,_mouseClickEventHandler:function(event,eventToTrigger){var $et=$(event.target),row=$et.closest("tr"),key=row.attr("data-id"),describedBy,colKey,$td,res,currGrid,colIndex=$et.closest("td").index(),rowIndex=row.index(),grid=this,i;if(grid.element.closest(".ui-iggrid-root").data("igGrid")){currGrid=$et.closest(this._isMultiRowGrid()?".ui-iggrid-table-mrl":".ui-iggrid-table").data("igGrid");if(currGrid&&grid.id()!==currGrid.id()){return}}if(key===""||key===null||key===undefined){key=rowIndex}$td=$(event.target);if(!$td.is("td")){$td=$(event.target).closest("td")}describedBy=$td.attr("aria-describedBy");if(describedBy===null||describedBy===undefined){return}describedBy=describedBy.split(" ");for(i=0;i0){this._initialChildren=this.element.children().clone(true)}this._initialAttributes=[];attr=this.element[0].attributes;for(i=0;i0&&container[0].attachEvent){this._resizeContainerHandler=$.proxy(this.resizeContainer,this);container[0].attachEvent("onresize",this._resizeContainerHandler)}}if(!this._resizeContainerHandler){this._resId=setInterval($.proxy(this.resizeContainer,this),this.resizeTimeout)}}for(i=0;i0){if(typeof data[0][pk]==="number"){val=parseInt(val,10)}}}}else{data=this.dataSource._data;if(data&&data.length>0){if(typeof data[0].ig_pk==="number"){val=parseInt(val,10)}}}return val},hasFixedDataSkippedColumns:function(){return!!this._hasFixedDataSkippedColumns},hasFixedColumns:function(){return this._hasFixedColumns},fixingDirection:function(){return this._fixingDirection},isFixedColumn:function(colKey){var isFixed=false,typeColKey=$.type(colKey),cols;if(!this.hasFixedColumns()){return false}if(typeColKey==="string"){$.each(this._fixedColumns,function(ind,c){if(c.key===colKey){isFixed=true;return false}})}else if(typeColKey==="number"){cols=this._visibleColumns();if(colKey<0||colKey>=cols.length){return false}isFixed=cols[colKey].fixed===true}return isFixed},_onFixedColumnsChanged:function(obj){this._fireInternalEvent("_fixedColumnsChanged",obj)},_onGroupedColumnsChanging:function(groupedColumns){this._fireInternalEvent("_groupedColumnsChanging",{groupedColumns:groupedColumns})},_onGroupedColumnsChanged:function(groupedColumns){this._fireInternalEvent("_groupedColumnsChanged",{groupedColumns:groupedColumns})},_testInnerHtml:function(){var t=document.createElement("table");try{t.innerHTML=" t ";this._canreplaceinner=true}catch(e){this._canreplaceinner=false}},resizeContainer:function(){var scrollContainerWidth,o=this.options,visibilityChanged=false,v=o.virtualization===true||o.rowVirtualization===true||o.columnVirtualization===true;if(this._recheckVisibility&&this.element.is(":visible")){this._prevContainerHeight=0;visibilityChanged=true;this._recheckVisibility=false;if(this._resId&&!(this.options.height!==null&&this.options.height.indexOf&&this.options.height.indexOf("%")!==-1||this.options.width!==null&&this.options.width.indexOf&&this.options.width.indexOf("%")!==-1)){clearInterval(this._resId)}}if(o.autoAdjustHeight&&this.container().height()!==this._prevContainerHeight){this._initializeHeights();if(v&&visibilityChanged){this._avgRowHeight=null;if(!this.container().find("#"+this.id()+" > tbody > tr:not([data-container]):visible:first").length){delete this._virtualDom;this._renderVirtualRecords()}this._updateVirtualScrollContainer();this._onVirtualVerticalScroll()}}if(o.width!==null&&o.height!==null){if(v===false){scrollContainerWidth=this.scrollContainer().width()}else{scrollContainerWidth=this._vdisplaycontainer().width()+this._scrollbarWidth()}if(!scrollContainerWidth){return}if(this._gridInnerWidth!==scrollContainerWidth&&(this._gridInnerWidth>0||scrollContainerWidth>0)){this._gridInnerWidth=scrollContainerWidth;this._updateHScrollbarVisibility()}if(v===false&&this.scrollContainer().get(0).scrollHeight>this.scrollContainer().get(0).clientHeight!==this._hasVerticalScrollbar){this._adjustLastColumnWidth()}}},_isMultiColumnHeader:function(){var cols=this.options.columns,i;for(i=0;i=0){if(!nv[ni]){nv[ni]=1}else{delete this._rlp[i][j].col.navigationIndex}}}}k=0;for(i=0;i0){this._colGroupWidths[col.columnIndex+cInd]=parseInt(currCol.width)-sum;subColsWidths[cInd]=this._colGroupWidths[col.columnIndex+cInd]}else{subColsWidths[cInd]=null}}}if(subColsWidths[cInd]===undefined){subColsWidths[cInd]=null}}nullWidths=$(subColsWidths).filter(function(index){return subColsWidths[index]===null||subColsWidths[index]===undefined});if(nullWidths.length===1){currSum=0;$(subColsWidths).each(function(index){if(subColsWidths[index]!==undefined&&subColsWidths[index]!==null){currSum+=parseInt(subColsWidths[index])}else{nullInd=index}});subColsWidths[nullInd]=parseInt(col.width)-currSum;this._colGroupWidths[col.columnIndex+nullInd]=subColsWidths[nullInd]}return subColsWidths},_resolveWidth:function(col,resolveCol){var t=this._rlm,colSpan=col.colSpan===undefined||col.colSpan===null?1:col.colSpan,columnIndex=col.columnIndex,rowIndex=col.rowIndex,rInd=0,cInd=0,currWidth,sum,subPartsCount=0,currCol,relColumn,commonPart,width=null;if(col.width!==undefined){return col.width}if(col.colSpan===1&&this._colGroupWidths[col.columnIndex]){return this._colGroupWidths[col.columnIndex]}for(rInd=0;rInd0){currWidth=this._calcCommonPartSum(relColumn,commonPart,resolveCol);if(!currWidth){return null}subPartsCount+=this._getCommonColIndexes(col,currCol).length}else{subPartsCount+=this._getCommonColIndexes(col,currCol).length}if(!currWidth){break}sum+=parseInt(currWidth,10)}}if(sum!==0&&subPartsCount===currCol.colSpan-commonPart.length){width=parseInt(currCol.width)-sum;break}}else if(commonPart.length0){if(resolveCol!==currCol.key&&resolveCol!==relColumn.key){currWidth=this._calcCommonPartSum(relColumn,commonPart,resolveCol);if(!currWidth){break}subPartsCount+=commonPart.length}else{break}}else{subPartsCount+=relColumn.colSpan}if(!currWidth){break}sum+=parseInt(currWidth,10)}if(sum!==0&&subPartsCount===colSpan){width=sum;break}}else if(commonPart.length0){if(resolveCol!==currCol.key&&resolveCol!==relColumn.key){currWidth=this._calcCommonPartSum(relColumn,commonPart,resolveCol);if(currWidth===null){return null}subPartsCount+=commonPart.length}else{break}}else{subPartsCount+=relColumn.colSpan}if(!currWidth){break}sum+=parseInt(currWidth,10);if(sum!==0&&subPartsCount===colSpan){width=sum;break}}}}return width},_getCommonColIndexes:function(col1,col2){var t=this._rlm,indexes=[],i;if(col1.colSpan===1&&t[col2.rowIndex][col1.columnIndex]===col2.key){indexes[0]=col1.columnIndex;return indexes}for(i=0;i=t.length){x=t.length-1;while(++x<=totalHeight){t.push(Array.apply(null,new Array(colLen)).map(function(){return null}))}}if(totalWidth>=colLen){for(x=0;xml){ml=l}}else if(rowspan>0){l=level+rowspan-1;if(l>ml){ml=l}}}return ml},_headerInit:function(tr,colgroup,prepend){var i;for(i=0;i=this.table.rows.length){i=this.table.rows.length-1}else if(i<0){i=0}return i},immediateChildrenWidgets:function(){return this.element.children("tbody").children("tr").children(".ui-iggrid-childarea").children("div").children("div").map(function(){if($(this).children(".ui-iggrid-scrolldiv").length>0){return $(this).children(".ui-iggrid-scrolldiv").children(".ui-iggrid-table").data("igGrid")}return $(this).children(".ui-iggrid-table").data("igGrid")})},childrenWidgets:function(){return this.element.find("tbody > tr > .ui-iggrid-childarea").find(".ui-iggrid-table").map(function(){return $(this).data("igGrid")})},children:function(){return this.element.find("tbody > tr > .ui-iggrid-childarea").find(".ui-iggrid-table")},immediateChildren:function(){return this.element.children("tbody").children("tr").children(".ui-iggrid-childarea").children("div").children("div").map(function(){if($(this).children(".ui-iggrid-scrolldiv").length>0){return $(this).children(".ui-iggrid-scrolldiv").children(".ui-iggrid-table")}return $(this).children(".ui-iggrid-table")})},rowAt:function(i){i=this._dataRowIndex(i);return this.table.rows[i]},rowById:function(rowId,isFixed){if(_aNull(rowId)){return null}if(isFixed){return this.fixedBodyContainer().find("tbody").first().children("[data-id='"+rowId+"']")}return this.element.children("tbody").children("[data-id='"+rowId+"']")},fixedRowAt:function(i){var rows=this.fixedBodyContainer().find("tbody>tr");if(rows.length>0){return rows[i]}return null},fixedRows:function(){return this.fixedBodyContainer().find("tbody>tr")},rows:function(){return this.element.children("tbody").children("tr")},allFixedRows:function(){return this.fixedBodyContainer().find("tbody tr")},allRows:function(){return this.element.find("tbody tr")},_getColumnInfo:function(id,cols){var aCols=cols||this._oldCols||this.options.columns,i;for(i=0;i0){for(i=0;i=this._getDataView().length){throw new Error(this._getLocaleValue("indexOutOfRange").replace("{max}",this._getDataView().length))}if($.type(colKey)==="string"){return this.dataSource.getCellValue(colKey,this._getDataView()[id])}if(cols.length<=colKey){throw new Error(this._getLocaleValue("columnIndexOutOfRange").replace("{max}",cols.length))}return this.dataSource.getCellValue(colKey,this._getDataView()[id])},getCellText:function(rowId,colKey){var colIndex;if($.type(colKey)==="string"){if(this.columnByKey(colKey)===null){throw new Error(this._getLocaleValue("columnNotFound").replace("{key}",colKey))}if(this.options.primaryKey!==null){return this._getCellsByColKey(this.element.find("tr[data-id='"+rowId+"']"),colKey).text()}else{return this._getCellsByColKey(this._getRowsByRecordIndex(rowId),colKey).text()}}else{if(this._isMultiRowGrid()){return null}colIndex=colKey}if(colIndex===undefined){throw new Error(this._getLocaleValue("columnNotFound").replace("{key}",colKey))}if(this.options.primaryKey!==null){return this.element.find("tr[data-id='"+rowId+"']>td:nth-child("+(colIndex+1)+")").text()}return $(this.cellAt(colIndex,parseInt(rowId,10))).text()},setColumnTemplate:function(col,tmpl,render){var colIdx=this._getColIdxById(this.options.columns,col);if(colIdx===null||colIdx===undefined){return}col=this.options.columns[colIdx];col.template=tmpl;render=render===null||render===undefined?true:render;if(render&&!col.hidden){this._renderData()}},commit:function(rowId){var key=this._normalizedKey(rowId),row,idx,oldScrollTop=this._getIgScrollPositionTop(),self=this;this.dataSource.commit(key);if(this._fireInternalEvent("_gridCommit")){return}this._isToSetUnboundColumns=true;if(this.options.virtualization||this.options.rowVirtualization||this.options.columnVirtualization){if(this.options.virtualizationMode==="continuous"){this._renderVirtualRecords()}else{this._buildVirtualDom();this.virtualScrollTo(this._startRowIndex)}}else if(key!==null){row=this.rowById(key);if(row&&row.length){if(row.hasClass(this.css.deletedRecord)){idx=row.index();row.remove();this._reapplyZebraStyle(idx)}else{row.removeClass(this.css.modifiedRecord)}}}else{this._renderData()}this._setIgScrollPositionTop(oldScrollTop)},rollback:function(rowId,updateUI){var key=this._normalizedKey(rowId),transactions=this.dataSource.rollback(key),i,funcUpdateUI,fCols=this.hasFixedColumns(),grid=this;if(updateUI===true){funcUpdateUI=function(transaction,fixed){var $tbl=fixed?grid.fixedTable():grid.element,tr=$tbl.find("tr[data-id='"+transaction.rowId+"']"),content,tridx,rec,td,index,col;switch(transaction.type){case"newrow":tridx=grid.element.children("tbody").children("tr:not([data-container],[data-grouprow],[data-summaryrow])").index(tr);tr.remove();grid._reapplyZebraStyle(tridx);break;case"deleterow":tr.removeClass(grid.css.deletedRecord);break;case"cell":col=grid.columnByKey(transaction.col);tr.removeClass(grid.css.modifiedRecord);td=grid.cellById(transaction.rowId,transaction.col);rec=grid.dataSource.findRecordByKey(transaction.rowId);if(col.template&&col.template.length){content=grid._renderTemplatedCell(rec,col);index=content.indexOf(">");content=content.substring(index+1,content.length);td.html(content)}else{td.html(String(grid._renderCell(rec[transaction.col],col,rec)))}break;case"row":tr.removeClass(grid.css.modifiedRecord);rec=grid.dataSource.findRecordByKey(transaction.rowId);grid._renderRow(rec,tr[0],rec[grid.options.primaryKey]);break}};if(!_aNull(rowId)){if(transactions.length===0){return}i=transactions.length;while(i-- >0){funcUpdateUI(transactions[i]);if(fCols){funcUpdateUI(transactions[i],true)}}this._fireInternalEvent("_rollbackApplied")}else{this.dataBind()}return transactions}},findRecordByKey:function(key){return this.dataSource.findRecordByKey(key)},getDetachedRecord:function(t){return this.dataSource.getDetachedRecord(t)},pendingTransactions:function(){return this.dataSource.pendingTransactions()},allTransactions:function(){return this.dataSource.allTransactions()},transactionsAsString:function(){return this.dataSource.transactionsAsString()},_normalizedKey:function(id){var key,primaryKeyCol;if(id===undefined||id===null){return null}key=id;if(this.options.primaryKey!==null){primaryKeyCol=this.columnByKey(this.options.primaryKey);if(primaryKeyCol.dataType==="number"||primaryKeyCol.dataType==="numeric"){key=parseInt(id,10)}}else{key=parseInt(id,10)}return key},saveChanges:function(success,error){this.dataSource.saveChanges(success,error)},_renderRow:function(rec,tr){var i,td,cols,col,cs,cl,content,cv=this._isColumnVirtualizationEnabled();tr=$(tr);cols=this._visibleColumns();cs=this._startColIndex||0;cl=cv?this._virtualColumnCount+cs:cols.length;for(i=cs;i").appendTo(this.element).attr("id",this.id()+"_table");this.element.data("igGrid",this)},dataBind:function(internal){var dataOptions,i,noCancel=true,noCancelRendering=true,customFunc,dataSource;if(!this._initialized){noCancelRendering=this._trigger(this.events.rendering,null,{owner:this})}if(noCancelRendering){dataOptions=this._generateDataSourceOptions(this.options);dataSource=this._createDataSource(dataOptions);noCancel=this._trigger(this.events.dataBinding,null,{owner:this,dataSource:dataSource});this.requiresDataBinding=internal===undefined?true:this.requiresDataBinding;if(noCancel){if(this.requiresDataBinding){if(this._hasUnboundColumns){this._rebindUnboundColumns=true}this._dataOptions=dataOptions;this.dataSource=dataSource;if(!this._initialized&&this.options.autoGenerateColumns){this.dataSource.settings.localSchemaTransform=false}if(!this._initialized){if(this.element.is("div")){this._wrapElementDiv()}for(i=0;i0){this.options.dataSource=this.element[0]}if(this.options.dataSource){if(this.options.dataSource.tagName&&this.options.dataSource.nodeType){t=$(this.options.dataSource)}else if($.type(this.options.dataSource.type)==="function"&&this.options.dataSource.type()==="htmlTableString"&&$.type(this.options.dataSource.dataSource)==="function"){t=$(this.options.dataSource.dataSource())}if(t&&t.is("table")&&t.find("thead th").length>0){headers=t.find("thead tr th");this._tb_h=true;this._tb_h_arr=[];for(i=0;i=0)||!instanceOfDs){dataOptions=$.extend(dataOptions,{schema:schema})}return dataOptions},_insertUnboundColumn:function(column){if(this._unboundColumns===null||this._unboundColumns===undefined){this._unboundColumns=[]}this._unboundColumns.push(column);if(column.key&&(this._unboundValues[column.key]===null||this._unboundValues[column.key]===undefined)){this._unboundValues[column.key]=[]}if(column.unboundValues&&column.unboundValues.length>0){this._isToSetUnboundColumns=true}this._hasUnboundColumns=true},_addUnboundColumnValue:function(key,value,index){if(this._unboundValues[key]===null||this._unboundValues[key]===undefined){this._unboundValues[key]=[]}if(index!==undefined&&index!==null){this._unboundValues[key][index]=value}else{this._unboundValues[key].push(value)}},_generateDataSourceSchema:function(){var schema,schemaType,dsSchema,i,rec,prop,count=0,cols=this.options.columns,ds=this.options.dataSource,cl,counter=0,colLayoutFilter=function(elem){return elem.key===prop};if(ds&&typeof ds._xmlToArray==="function"&&typeof ds._encodePkParams==="function"){dsSchema=ds.schema();if(dsSchema&&$.type(dsSchema)==="object"&&typeof dsSchema.schema==="object"&&typeof dsSchema.isObjEmpty==="function"&&dsSchema._type){schemaType=dsSchema._type;if(schemaType&&schemaType!==ds.settings.type){ds.settings.type=schemaType}}else{dsSchema=null}if($.type(ds.settings.dataSource)==="array"||$.type(ds.settings.dataSource)==="object"){ds=ds.settings.dataSource}else if($.type(ds.settings.dataSource)!=="string"){ds=ds.data()}else{ds=[]}}if($.type(ds)==="string"&&this.dataSource){ds=this.dataSource.data()}if($.type(ds)==="object"&&this.options.responseDataKey){ds=$.ig.findPath(ds,this.options.responseDataKey)}schema={};schema.fields=[];schema.searchField=this.options.responseDataKey;this._unboundColumns=null;if(cols.length>0){for(i=0;i0){for(i=0;i0){rec=$(ds).find("tbody tr")[0];$(rec).find("td").each(function(){if(cols.length>count){schema.fields.push({name:cols[count].key||count+1,type:cols[count].dataType||"string"})}else{schema.fields.push({name:count+1,type:"string"})}count++})}else if(ds&&ds.length&&ds.length>0&&$.type(ds)==="array"){for(i=0;i0){schema.fields.push({name:prop})}else if(this.columnByKey(prop)!==null){schema.fields.push({name:prop,type:this.columnByKey(prop).dataType})}count++}}if(!this.options._recurseSchema){break}}}else if(dsSchema&&dsSchema.fields().length){schema.fields=dsSchema.fields()}for(i=0;i0){if(isTable){r=$(ds).find("tbody tr")[0]}else{r=ds[0]}if($.type(r)==="array"||isTable){hasHeaders=this._tb_h;if(isTable){$(r).find("td").each(function(){arr.push($(this).text())});r=arr}for(i=0;i0)){throw new Error(this._getLocaleValue("columnVirtualizationNotSupportedWithPercentageWidth"))}if(this._isMultiRowGrid()&&(this.options.virtualization===true||this.options.rowVirtualization===true)&&this.options.virtualizationMode!=="continuous"){throw new Error(this._getLocaleValue("featureNotSupportedWithMRL").replace("{featureName}","Fixed Virtualization"))}this._createVirtualGrid()}else if(this.options.height!==null||this.options.width!==null){this._createScrollingGrid()}else{containerId=gridElement.id+"_container";containerDiv='
';this.element.wrap(containerDiv);this.element.addClass(this._isMultiRowGrid()?this.css.mrlGridTableClass:this.css.gridTableClass);this.element.attr("aria-describedby",_aNull(this.options.caption)?containerId:this.id()+"_caption");this._setContainerWidth(this.container());this.container().attr("tabIndex",this.options.tabIndex);if(this.options.height!==null){this.container().css("overflow-y","hidden")}}this._touch();if(this.options.columns.length>0&&(this.options.virtualization!==true&&this.options.rowVirtualization!==true&&this.options.columnVirtualization!==true)&&this.options.autogenerateColumns===false&&this.options.columns.length>0){this._renderColgroup(this.element[0],false,false,this.options.autofitLastColumn)}$(gridElement).attr("cellpadding","0");$(gridElement).attr("cellspacing","0");$(gridElement).attr("border","0");$(gridElement).css("table-layout","fixed");$(gridElement).addClass(this._isMultiRowGrid()?this.css.mrlGridTableClass:this.css.gridTableClass);if(this.options.autoGenerateColumns===false&&!this._autoDetectColTypes()&&this.options.columns.length>0&&this._headerRenderCancel!==true){this._renderHeader()}this._renderCaption();if(this.options.autoAdjustHeight){this._initializeHeights()}}if(tbody.length===0){tbody=$('').appendTo(gridElement).addClass(this.css.baseContentClass).addClass(this.css.gridTableBodyClass).addClass(this.css.recordClass)}if(this.dataSource.type()!=="htmlTableDom"&&this.dataSource.type()!=="htmlTableId"){tbody.attr("role","rowgroup").empty();if(this.hasFixedColumns()){this.fixedBodyContainer().children("table").children("tbody").attr("role","rowgroup").empty()}}},_autoDetectColTypes:function(){var i,cols=this.options.columns;for(i=0;i0){inPerc=false;for(i=0;i0){inPerc=true}else{inPerc=false;break}}if(inPerc){return}this._scrollWidthAddedToContainerWidth=this.hasVerticalScrollbar();width=this._calculateContainerWidth(this._scrollWidthAddedToContainerWidth);if(width>0){if(rendered){width=0;this.container().find(".ui-iggrid-header").each(function(){width+=$(this).outerWidth()});element.width(width)}else{width+=this._calculateSpecialColumnsWidth();element.css("width",width)}}}else if(this.options.width!==null){element.css("width",this.options.width)}},_calculateContainerWidth:function(addScrollWidth){var width=0,cols=this.options.columns,i;for(i=0;i0&&addScrollWidth===true){width+=this._scrollbarWidth()}return width},_createScrollingGrid:function(){var self=this,id=this.id()+"_scroll",dataContainer,scrollDiv='
';this.element.wrap(scrollDiv);dataContainer=this.element.parent();this.element.attr("aria-describedby",_aNull(this.options.caption)?id:this.id()+"_caption");dataContainer.addClass(this.css.gridScrollDivClass).wrap('
');if($.ig.util.isIE7){dataContainer.css("padding-bottom",this._scrollbarWidth())}this.container().attr("tabIndex",this.options.tabIndex).addClass(this.css.baseClass).addClass(this.css.gridClasses);if(this.options.width!==null){this.container().css("width",this.options.width);if(this.options.width.indexOf&&this.options.width.indexOf("%")!==-1){this.element.css("width","100%"); }if(this.options.height!==null){this._addHorizontalScrollBar(dataContainer);this.scrollContainer().css("overflow-x","hidden")}}else{this._setContainerWidth(this.container());this.scrollContainer().css("overflow-x","hidden")}this.container().css("position","relative");if(this.options.height!==null){this.scrollContainer().css("overflow-y","auto");if(this.options.autoAdjustHeight){this.container().css("height",this.options.height)}else{this.scrollContainer().css("height",this.options.height)}}if(this._persistVirtualScrollTop){this.scrollContainer().bind({scroll:function(){self._prevFirstVisibleTROffset=self.scrollContainer().scrollTop()}})}this.scrollContainer().bind({wheel:function(event){self._hscrollbarcontent().scrollLeft(self._hscrollbarcontent().scrollLeft()+event.originalEvent.deltaX)}})},_igScrollCreated:function(evt){var div,id=this.id(),self=this,scrollSettings=this.options.scrollSettings;if(this.options.virtualization===true||this.options.rowVirtualization===true||this.options.columnVirtualization){div=this._vdisplaycontainer();if(!div.data("igScroll")._bMixedEnvironment&&$.ig.util.isTouchDevice()){div.css("overflow","hidden")}div.igScroll("option","scrollOnlyVBar",true);if(this.options.showHeader&&this.headersTable().length){div.igScroll("option","syncedElemsH",[this.headersTable()])}div.igScroll("option","scrollbarV",this._scrollContainer());if(this.options.virtualizationMode==="fixed"&&!this.options.columnVirtualization&&!this.options.virtualization&&this._hscrollbarcontent().length){div.igScroll("option","scrollbarH",this._hscrollbarcontent())}else if(this._vhorizontalcontainer().length){div.igScroll("option","scrollbarH",this._vhorizontalcontainer())}div.data("igScroll")._bMixedEnvironment=true;div.data("igScroll")._content=this._scrollContainer().children(":first-child");div.data("igScroll")._contentX=this.element;div.igScroll("refresh");div.igScroll("option","scrollWidth",this._calculateContainerWidth());if(this.options.columnVirtualization){div.igScroll("option","scrollOnlyHBar",true)}this._enableVirtualTouchScrollbars();div.igScroll("option",scrollSettings);div.on("iggridrendered",function(evt,ui){if(self.id()===ui.owner.id()){self._enableVirtualTouchScrollbars();div.igScroll("option",scrollSettings)}})}else{div=this.scrollContainer();if(!div.data("igScroll")._bMixedEnvironment&&$.ig.util.isTouchDevice()){div.css("overflow","hidden")}div.data("igScroll")._content=this.element;div.igScroll("refresh");div.igScroll("option","scrollOnlyVBar",false);if($(".ui-widget-footer table",this.container()).length>0){div.igScroll("option","syncedElemsH",[$(".ui-widget-footer table",this.container())])}if(this.options.showHeader&&this.options.fixedHeaders&&this.headersTable().length){if($(".ui-widget-footer table",this.container()).length>0){div.igScroll("option","syncedElemsH",[$(".ui-widget-footer table",this.container()),this.headersTable()])}else{div.igScroll("option","syncedElemsH",[this.headersTable()])}}this._enableTouchScrollbars();div.igScroll("option",scrollSettings);div.on("iggridrendered",function(evt,ui){if(self.id()===ui.owner.id()){self._enableTouchScrollbars();div.igScroll("option",scrollSettings)}});this.element.on("iggrid_heightchanged",$.proxy(this._enableTouchScrollbars,this));div.on("iggridrowsrendered",$.proxy(this._enableTouchScrollbars,this))}div.on("igscrollresized",$.proxy(this._igScrollResized,this));div.on("iggriddatarendered",function(){self._refreshIgScrollBars()});evt.stopPropagation()},_igScrollResized:function(){var scrollContainer;if(this.options.virtualization||this.options.rowVirtualization||this.options.columnVirtualization){scrollContainer=this._vdisplaycontainer();scrollContainer.igScroll("refresh");scrollContainer.igScroll("option","scrollWidth",this._calculateContainerWidth())}else{scrollContainer=this.scrollContainer();scrollContainer.igScroll("refresh")}},_enableTouchScrollbars:function(){var div=this.scrollContainer(),scrollbarsWrapper=$("#"+this.element[0].id+"_igscrolls_container",this.container());if(div.data("igScroll")===undefined||!$.ig.util.isTouchDevice()){return}if(!scrollbarsWrapper.length){scrollbarsWrapper=$('
').css("position","relative").css("height","0px").insertAfter(div);$(".ui-iggrid-pager",this.container()).css("overflow","hidden")}div.igScroll("option","scrollbarType","none");div.igScroll("refresh");div.igScroll("option","scrollbarHParent",scrollbarsWrapper);div.igScroll("option","scrollbarVParent",scrollbarsWrapper);if($.ig.util.isSafari){div.igScroll("option","scrollbarType","custom");if($(".igscroll-vcontainer",this.container()).length>0){$(".igscroll-vcontainer",this.container()).css("top",-div.height()+"px")}}else if($.ig.util.getScrollWidth()===0){div.igScroll("option","scrollbarType","native");if(div.data("igScroll")._vBarContainer){div.data("igScroll")._vBarContainer.css("top",-div.height()+"px").css("height",div.height()+"px").css("z-index",2).attr("touch-bar","true")}if(div.data("igScroll")._hBarContainer){div.data("igScroll")._hBarContainer.css("z-index",2).attr("touch-bar","true")}}if(this.fixedBodyContainer().length){if($(".igscroll-hcontainer",this.container()).length>0&&this.fixingDirection()==="left"){$(".igscroll-hcontainer",this.container()).css("left",this.fixedBodyContainer().width())}else if($(".igscroll-hcontainer",this.container()).length>0&&this.fixingDirection()==="right"){$(".igscroll-hcontainer",this.container()).css("right",this.fixedBodyContainer().width())}if($(".igscroll-hnative-outer",this.container()).length>0&&this.fixingDirection()==="left"){$(".igscroll-hnative-outer",this.container()).css("left",this.fixedBodyContainer().width())}else if($(".igscroll-hnative-outer",this.container()).length>0&&this.fixingDirection()==="right"){$(".igscroll-hnative-outer",this.container()).css("right",this.fixedBodyContainer().width())}}},_refreshIgScrollBars:function(){var $scrollContainer=this.scrollContainer();if(!$scrollContainer.length||$scrollContainer.data("igScroll")===undefined){return}$scrollContainer.igScroll("refresh");if($(".igscroll-vcontainer",this.container())){$(".igscroll-vcontainer",this.container()).css("top",-$scrollContainer.height()+"px")}if($(".igscroll-vnative-outer",this.container())){$(".igscroll-vnative-outer",this.container()).css("top",-$scrollContainer.height()+"px").css("z-index",2)}},_enableVirtualTouchScrollbars:function(){var div=this._vdisplaycontainer(),scrollbarsWrapper,vericalScrollContainer;if($.ig.util.getScrollWidth()===0){scrollbarsWrapper=div.parent().find("."+this.css.gridScrollbarsWrapper);if(scrollbarsWrapper.length){scrollbarsWrapper.remove()}div.parent().css("position","relative");scrollbarsWrapper=$("
").appendTo(div.parent());scrollbarsWrapper.addClass(this.css.gridScrollbarsWrapper).css("position","absolute").css("top","0px").css("bottom","0px").css("left","0px").css("right","0px");div.igScroll("refresh");div.igScroll("option","scrollWidth",this._calculateContainerWidth());div.igScroll("option","scrollbarHParent",scrollbarsWrapper);div.igScroll("option","scrollbarVParent",scrollbarsWrapper);div.igScroll("option","scrollbarType","custom")}},_getIgScrollPositionTop:function(){var sl,scrollTop;if(this.options.virtualization||this.options.rowVirtualization||this.options.columnVirtualization){scrollTop=this._scrollContainer().scrollTop()}else{sl=this.scrollContainer().data("igScroll");scrollTop=sl?sl.option("scrollTop"):this.scrollContainer().scrollTop()}return scrollTop},_setIgScrollPositionTop:function(inScrollTop){var sl;if(this.options.virtualization||this.options.rowVirtualization||this.options.columnVirtualization){sl=this._vdisplaycontainer().data("igScroll")}else{sl=this.scrollContainer().data("igScroll")}if(sl){sl.option("scrollTop",inScrollTop)}},_touch:function(){var id=this.id(),div=this.scrollContainer();if(div.length!==1){div=this._vdisplaycontainer()}if(div.length){div.attr("data-scroll","true").attr("data-oneDirection","true");if(this._hscrollbarcontent()[0]){div.attr("data-xScroller","#"+id+"_hscroller")}else if(this._vhorizontalcontainer()[0]){div.attr("data-xScroller","#"+id+"_horizontalScrollContainer")}if(this._scrollContainer()[0]){div.attr("data-yScroller","#"+id+"_scrollContainer")}div.bind("igscrollrendered",$.proxy(this._igScrollCreated,this));if($.ig.util.isTouchDevice()&&$.ig.util.getScrollWidth()===0&&this.element.igScroll!==undefined){this._scrollbarWidthResolved=0}}},_createVirtualGrid:function(){var id=this.id(),$vCont,evnts,$vDsplCntnr,grid,newW,funcOnScroll,percWidthStr=$.ig.util.isWebKit?"width=100%":"",totalWidth,scrollContainerInner,scrollbarWidth,w=0,virtualGridMarkup='
$verticalMarkup$$horizontalMarkup$
',verticalMarkup,horizontalMarkup='
';scrollbarWidth=this._scrollbarWidth();if($.ig.util.isIE){scrollbarWidth+=1}if(parseInt(this.options.height,10)>0){verticalMarkup='
'}else{verticalMarkup='
'}if(this.options.virtualization===true){virtualGridMarkup=virtualGridMarkup.replace("$verticalMarkup$",verticalMarkup).replace("$horizontalMarkup$",horizontalMarkup)}else if(this.options.rowVirtualization===true){virtualGridMarkup=virtualGridMarkup.replace("$verticalMarkup$",verticalMarkup).replace("$horizontalMarkup$","")}else if(this.options.columnVirtualization===true){virtualGridMarkup=virtualGridMarkup.replace("$horizontalMarkup$",horizontalMarkup).replace("$verticalMarkup$","")}if(this.options.virtualization===true||this.options.columnVirtualization===true){this.element.css("width","100%")}this.element.wrap(virtualGridMarkup);this.container().attr("tabIndex",this.options.tabIndex).addClass(this.css.baseClass).addClass(this.css.gridClasses);if(this.options.width!==null){this.container().width(this.options.width)}else{this._setContainerWidth(this.container())}this._vdisplaycontainer().addClass(this.css.gridScrollDivClass).addClass(this.css.gridVirtualScrollDivClass).append(this.element[0]);grid=this;totalWidth=this._calculateContainerWidth(false);if(this.options.width!==null){w=parseInt(this.options.width,10)}else{w=totalWidth}if(this.options.height!==null&&this.options.width!==null){w-=this._scrollbarWidth()}if(w<=0){w=undefined}if(w>0&&this.options.expandColWidth&&!this.options.width){w+=this.options.expandColWidth}$("').prependTo(this._virtualcontainer());newW=this.options.width;if(newW&&newW.indexOf&&newW.indexOf("%")!==-1){newW="100%"}this._virtualcontainer().css("width",newW).css("max-width",newW);scrollContainerInner='
';this._scrollContainer().append(scrollContainerInner);if($.ig.util.isFF&&this.options.virtualizationMode==="fixed"){this._scrollContainer().height(0)}if((this.options.virtualization===true||this.options.rowVirtualization===true)&&this.options.width&&this.options.width.indexOf&&this.options.width.indexOf("%")>0){this._addHorizontalScrollBar(this._virtualcontainer());this._virtualcontainer().css("table-layout","fixed")}else if((this.options.virtualization===true||this.options.columnVirtualization===true)&&this.options.width&&totalWidth>parseInt(this.options.width,10)){this._renderHorizontalScrollContainer(totalWidth)}if(parseInt(this.options.height,10)>0){this._vdisplaycontainer().css("height",this.options.height).css("vertical-align","top")}this._vdisplaycontainer().css("position","relative").css("width",w).css("maxWidth",w);if(this.options.virtualization===true){this.container().find("#"+id+"_headers_v").append(' ')}if(this.options.width&&this.options.virtualization===false&&this.options.columnVirtualization===false){this._vdisplaycontainer().css({"overflow-y":"hidden","overflow-x":"auto"})}else{this._vdisplaycontainer().css("overflow","hidden")}this._vdisplaycontainer().parent().bind({mouseenter:function(){grid._isMouseOverVirtualTable=true},mouseleave:function(){grid._isMouseOverVirtualTable=false}});this._documentEvents={DOMMouseScroll:function(event){var dir="down",delta,step,deltaX,oldScrollX,scrolledX=0,scrolledY=0,avgRowHeight=grid.options.avgRowHeight!==null?parseInt(grid.options.avgRowHeight,10):0;step=grid.options.virtualizationMouseWheelStep===null?avgRowHeight:grid.options.virtualizationMouseWheelStep;delta=-event.originalEvent.detail/3;if(delta>0){dir="up"}if(grid._isMouseOverVirtualTable&&!event.ctrlKey){if(event.originalEvent.axis===2){scrolledY=grid._onVirtualVerticalScroll(event,step,dir)}deltaX=event.originalEvent.offsetX;oldScrollX=grid._vdisplaycontainer().scrollLeft();if(event.originalEvent.axis===1){grid._vdisplaycontainer().scrollLeft(grid._vdisplaycontainer().scrollLeft()-delta)}scrolledX=grid._vdisplaycontainer().scrollLeft()-oldScrollX;if(scrolledY!==0||scrolledX!==0){event.preventDefault()}}},mousewheel:function(event){var dir="down",delta,step,oldScrollX,scrolledX=0,scrolledY=0,avgRowHeight=grid.options.avgRowHeight!==null?parseInt(grid.options.avgRowHeight,10):0;step=grid.options.virtualizationMouseWheelStep===null?avgRowHeight:grid.options.virtualizationMouseWheelStep;delta=(event.originalEvent.wheelDeltaY===undefined?event.originalEvent.wheelDelta:event.originalEvent.wheelDeltaY)/120;if(delta>0){dir="up"}if(grid._isMouseOverVirtualTable&&!event.ctrlKey){if(delta!==0){scrolledY=grid._onVirtualVerticalScroll(event,step,dir)}oldScrollX=grid._vdisplaycontainer().scrollLeft();grid._vdisplaycontainer().scrollLeft(grid._vdisplaycontainer().scrollLeft()-event.originalEvent.wheelDeltaX);scrolledX=grid._vdisplaycontainer().scrollLeft()-oldScrollX;if(scrolledY!==0||scrolledX!==0){event.preventDefault()}}},wheel:function(event){var dir="down",step,delta,oldScrollX,scrolledX=0,scrolledY=0,avgRowHeight=grid.options.avgRowHeight!==null?parseInt(grid.options.avgRowHeight,10):0;step=grid.options.virtualizationMouseWheelStep===null?avgRowHeight:grid.options.virtualizationMouseWheelStep;delta=-event.originalEvent.deltaY;if(delta>0){dir="up"}if(grid._isMouseOverVirtualTable&&!event.ctrlKey){if(delta!==0){scrolledY=grid._onVirtualVerticalScroll(event,step,dir)}oldScrollX=grid._vdisplaycontainer().scrollLeft();grid._vdisplaycontainer().scrollLeft(grid._vdisplaycontainer().scrollLeft()+event.originalEvent.deltaX);scrolledX=grid._vdisplaycontainer().scrollLeft()-oldScrollX;if(scrolledY!==0||scrolledX!==0){event.preventDefault()}}}};evnts={};$vDsplCntnr=this._vdisplaycontainer();if(this.options.virtualizationMode==="fixed"){evnts["keydown.virtualizationEvents"]=function(e){if(e.keyCode===$.ui.keyCode.TAB){grid._syncScrollOnTabFixedVirt(e,e.shiftKey?"up":"down",$vDsplCntnr)}}}else{evnts["keydown.virtualizationEvents"]=function(e){if(e.keyCode===$.ui.keyCode.TAB){grid._syncScrollOnTab(e,e.shiftKey?"up":"down",$vDsplCntnr)}}}$vDsplCntnr.bind(evnts);this._documentEvents["keydown."+this.id()]=function(event){var keyCode=event.keyCode,$sc,dir=null,step;if(grid._isMouseOverVirtualTable){if(keyCode===$.ui.keyCode.DOWN){dir=1}else if(keyCode===$.ui.keyCode.UP){dir=-1}if(dir&&grid._isMouseOverVirtualTable){step=grid.options.virtualizationMouseWheelStep===null?parseInt(grid.options.avgRowHeight,10):grid.options.virtualizationMouseWheelStep;$sc=grid._scrollContainer();$sc.scrollTop($sc.scrollTop()+step*dir)}}};$(document).bind(this._documentEvents);if(this.options.virtualization===true||this.options.rowVirtualization===true){this._scrollContainer().bind({scroll:function(event){grid._onVirtualVerticalScroll(event);grid._virtualScrollMouseDown=false},mousedown:function(){grid._virtualScrollMouseDown=true}})}if(this.options.virtualization===true||this.options.columnVirtualization===true){$vCont=this._vhorizontalcontainer();$vCont.data("containerName","vScrollbar").bind({scroll:function(event){grid._onVirtualHorizontalScroll(event)}});if(this.options.virtualizationMode==="continuous"){this._registerScrllCntnrToSync($vCont)}}if(this._vhorizontalcontainer().length===0&&this.options.width!==null){if(!this.options.width.indexOf||this.options.width.indexOf("%")===-1){this._addHorizontalScrollBar(this._virtualcontainer())}this._vdisplaycontainer().css("overflow-x","hidden")}this.element.height(this._scrollContainer().height());if(this.options.width&&this.options.width.indexOf&&this.options.width.indexOf("%")!==-1){this.container().find("#"+id+"_virtualContainer > colgroup > col:first").css("width","100%");this._vhorizontalcontainer().css("width","100%");this._vdisplaycontainer().css("width","100%").css("max-width","100%")}},_syncScrollOnTabFixedVirt:function(e,dir,$vDsplCntnr){$vDsplCntnr=$vDsplCntnr||this._vdisplaycontainer();var $ae=$(document.activeElement),$next,isDown=dir==="down",scrlTop,$scrlCntnr,h,selFirstLastChild=isDown?":last-child":":first-child";$next=isDown?$ae.closest("tr").next():$ae.closest("tr").prev();if(!$ae.is("td, th")||!$ae.is(selFirstLastChild)||$next.length){return}$scrlCntnr=this._scrollContainer();scrlTop=$scrlCntnr.scrollTop();h=parseInt(this.options.avgRowHeight,10);scrlTop+=isDown?h:-h;$scrlCntnr.scrollTop(scrlTop);if(scrlTop<=0||scrlTop+$vDsplCntnr.outerHeight()>=$scrlCntnr.children("div").outerHeight()){return}e.preventDefault()},_syncScrollOnTab:function(e,dir,$vDsplCntnr){$vDsplCntnr=$vDsplCntnr||this._vdisplaycontainer();var $ae=$(document.activeElement),$next,$currTr,$scCntnr,scrTop,id,isDown=dir==="down",selFirstLastChild=isDown?":last-child":":first-child";if(!$ae.is("td, th")||!$ae.is(selFirstLastChild)){return}$currTr=$ae.closest("tr");$next=isDown?$currTr.next():$currTr.prev();this._focusDataRowIndex=null;if(!$next.length){$scCntnr=this._scrollContainer();scrTop=$scCntnr.scrollTop();if(isDown){if($scCntnr[0].scrollHeight-scrTop===$scCntnr.outerHeight()){this._focusDataRowIndex=0}else{$scCntnr.scrollTop(scrTop+2);id=parseInt($currTr.attr("data-row-idx"),10);this._focusDataRowIndex=!isNaN(id)&&id-1>0?id-1:null}return}else if(!isDown){if(!scrTop){this._focusDataRowIndex=this._getTotalRowsCount()-1;return}else{$scCntnr.scrollTop(scrTop-2);id=parseInt($currTr.attr("data-row-idx"),10);this._focusDataRowIndex=!isNaN(id)&&id-1>0?id-1:null}}e.preventDefault();return}this._focusDataRowIndex=parseInt($next.attr("data-row-idx"),10);this._onVirtualVerticalScroll(e,$next.outerHeight(),dir)},_renderHorizontalScrollContainer:function(totalWidth){var horizontalScrollContainerInner,w=this.options.width,$vhc=this._vhorizontalcontainer();if(w&&w.indexOf&&w.indexOf("%")!==-1&&(this.options.virtualization===true||this.options.rowVirtualization===true)){return}$vhc.css("height",this._scrollbarWidth()+"px").css("overflow","scroll");w=this.hasFixedColumns()?parseFloat(w)-this.fixedBodyContainer().outerWidth():w;if($.ig.util.isIE||$.ig.util.isEdge){$vhc.css("width",parseInt(w,10)+1).css("height",$vhc.outerHeight()+1+"px")}else{if($.ig.util.isFF&&($.type(w)==="number"||w&&w.indexOf&&w.indexOf("px")>0)){w=parseFloat(w)-this._scrollbarWidth()}$vhc.css("width",w)}horizontalScrollContainerInner='
';$vhc.append(horizontalScrollContainerInner)},_suppressVirtVertScroll:function(suppress){this._virtVertScrollSuppressed=suppress},_isVirtVertScrollSuppressed:function(){if(this._virtVertScrollSuppressed){return true}return false},_correctVirtVertScrollTop:function(oldScrollTop,oldScrollContHeight){this._suppressVirtVertScroll();this._setScrollContainerScrollTop(oldScrollTop/oldScrollContHeight*this._getScrollContainerHeight());this._suppressVirtVertScroll(false)},_onVirtualVerticalScroll:function(event,offset,dir){this._isHorizontal=false;if(this._isVirtVertScrollSuppressed()){return}var newSri,scrollContainer=this._scrollContainer(),scrollTopDiff,isIE=$.ig.util.isIE,scrollerHeight,avgRowHeight=parseInt(this.options.avgRowHeight,10),current=scrollContainer.scrollTop(),mode=this.options.virtualizationMode;if(offset!==undefined){if(dir==="down"){scrollContainer.scrollTop(current+offset)}else{scrollContainer.scrollTop(current-offset)}current=scrollContainer.scrollTop()}scrollTopDiff=scrollContainer.scrollTop()-this._oldScrollTop;if(Math.abs(scrollTopDiff)<5&&$.ig.util.isFF&&!isIE){return scrollTopDiff}if(mode===undefined||mode===""){mode="continuous"}if(mode==="fixed"){newSri=Math.ceil(scrollContainer.scrollTop()/avgRowHeight);if($.ig.util.isIE){scrollerHeight=this._getScrollContainerHeight();if(this._totalRowCount*avgRowHeight>=scrollerHeight+2){if(current+5>scrollerHeight-scrollContainer.innerHeight()){newSri=this._getDataView().length-this._virtualRowCount}else{newSri=Math.ceil(current/scrollerHeight*this._totalRowCount)}}}else if(newSri===this._startRowIndex&&this._virtualScrollMouseDown){if(scrollTopDiff>0&&scrollTopDiffthis._totalRowCount-this._virtualRowCount){newSri=this._totalRowCount-this._virtualRowCount}if(newSri<0){newSri=0}if(newSri!==this._startRowIndex){this._startRowIndex=newSri;this._renderVirtualRecords()}}else if(mode==="continuous"){this._virtualScrollToInternal(current)}this._oldScrollTop=scrollContainer.scrollTop();this._oldDisplayContainerScrollTop=this._vdisplaycontainer().scrollTop();if(this._persistVirtualScrollTop){this._saveFirstVisibleTRIndex()}return scrollTopDiff},_scrollContainer:function(){if(!this._scrollContainerObj||this._scrollContainerObj.length===0){this._scrollContainerObj=this.container().find("#"+this.id()+"_scrollContainer")}return this._scrollContainerObj},_onVirtualHorizontalScroll:function(event){var newSci,internallyTriggered=event===undefined,horizontalScrollContainer=this._vhorizontalcontainer(),scrollLeft=horizontalScrollContainer.scrollLeft(),hiddenContentWidth=horizontalScrollContainer[0].scrollWidth-horizontalScrollContainer[0].offsetWidth;if(this.options.virtualization===true&&this.options.virtualizationMode==="continuous"){this._onScrollContainer(event);return}this._isHorizontal=true;if(hiddenContentWidth>0){newSci=Math.ceil(scrollLeft*this._totalColumnCount/hiddenContentWidth);newSci=Math.min(newSci,this._totalColumnCount-this._virtualColumnCount)}else{newSci=0}if(internallyTriggered||newSci!==this._startColIndex){this._startColIndex=newSci;this._renderVirtualRecords();this._trigger("virtualhorizontalscroll",null,{startColIndex:this._startColIndex,endColIndex:this._startColIndex+this._virtualColumnCount-1})}},_initLoadingIndicator:function(){var widget;if(this.container().data("igLoading")){this._loadingIndicator=this.container().data("igLoading").indicator()}else{widget=this.container().igLoading().data("igLoading");if(widget){this._loadingIndicator=widget.indicator()}}},_addHorizontalScrollBar:function(parent){this._outerHScrollbar=true;var sb=$('
').css("height",this._scrollbarWidth()+"px").css("position","relative").css("display","none").css("overflow","hidden").append($('
').data("containerName","hScrollbar").css("width","100%").css("position","absolute").css("bottom","0px").css("overflow-x","scroll").css("overflow-y","scroll").append($("
").css("height","1px")).bind("scroll",$.proxy(this._onScrollContainerHandler,this)));if(parent){sb.insertAfter(parent)}this._registerScrllCntnrToSync($("#"+this.id()+"_hscroller"))},_updateVirtualHorizontalScrollbar:function(){var horizontalScrollContainerInner,horizontalScrollContainer,isVisible;horizontalScrollContainerInner=this.container().find("#"+this.id()+"_horizontalScrollContainer div");horizontalScrollContainerInner.css("width",this._calculateContainerWidth(false));horizontalScrollContainer=this._vhorizontalcontainer();isVisible=horizontalScrollContainer.is(":visible");if(horizontalScrollContainer.width()>horizontalScrollContainerInner.width()){horizontalScrollContainer.css("display","none")}else{horizontalScrollContainer.css("display","")}if(isVisible!==horizontalScrollContainer.is(":visible")){this._initializeHeights()}},_generateColumnFlatStructure:function(treeStructure){var cols,oldCols,newCols=[];cols=treeStructure.slice(0);oldCols=treeStructure.slice(0);this._multiColumnIdentifier=0;this._maxLevel=this._getMaxLevelRecursive(0,cols);this._hiddenColumns={};this._analyzeMultiColumnHeaders(cols,newCols,0,oldCols,[]);this._oldCols=oldCols;this.options.columns=newCols},moveColumn:function(column,target,after,inDom,callback){var grid=this,found,nColArray,movingParams,hcPreserve,isFixed,cCols=this._oldCols?$.extend(true,[],this._oldCols):$.extend(true,[],this.options.columns);after=after===null||after===undefined?true:after;inDom=inDom===null||inDom===undefined?true:inDom;movingParams={column:column,target:target,after:after};if(this._oldCols){found=this._performInternalMove(movingParams,this._oldCols);hcPreserve=$.extend(true,{},this._hiddenColumns);this._generateColumnFlatStructure(this._oldCols);this._hiddenColumns=hcPreserve;this._preserveColspans(this._oldCols)}else{found=this._performInternalMove(movingParams,this.options.columns)}if(found===false){throw new Error(this._getLocaleValue("movingNotAllowedOrIncompatible"))}if(movingParams.columnFixed===movingParams.targetFixed){nColArray=this._buildColumnLayoutArray(cCols,movingParams.columnFixed)}else{return movingParams}column=movingParams.column;target=movingParams.target;after=movingParams.after;isFixed=movingParams.columnFixed;if(inDom===true){this._loadingIndicator.show();setTimeout(function(){grid._columnMovingResets();grid._performDomColumnMove(column,target,after,nColArray,isFixed);grid._updateVerticalScrollbarCellPadding(true);grid._loadingIndicator.hide();if(callback){$.ig.util.invokeCallback(callback,[grid.options.columns])}},0)}else{this._columnMovingResets();this._performColumnMove(column,target,after,nColArray,isFixed);if(callback){$.ig.util.invokeCallback(callback,[grid.options.columns])}}},_columnMovingResets:function(){var i,$th;this._updateHeaderColumnIndexes();delete this._virtualDom;delete this._visibleColumnsArray;this._headerCells=[];for(i=0;i1){return-1}return col.key||col.identifier},_performInternalMove:function(movingParams,subset){var i=0,j,success=true;i=this._getColIdxById(subset,movingParams.column);if(typeof movingParams.column==="number"){movingParams.column=subset[i].key||subset[i].identifier}if(i||i===0){movingParams.columnFixed=this._isSubsetFixed(subset[i]);j=this._getColIdxById(subset,movingParams.target);if(typeof movingParams.target==="number"){movingParams.target=subset[j].key||subset[j].identifier;movingParams.after=j>=i}if(j||j===0){movingParams.targetFixed=this._isSubsetFixed(subset[j]);delete subset[i].oWidth;delete subset[j].oWidth;success=success&&this._rearrangeArray(subset,i,1,movingParams.after===true?j+1:j);success=success||movingParams.targetFixed!==movingParams.columnFixed;return success}return false}for(i=0;itr:not([data-grouprow='true'],[data-summaryrow='true']):first").children("th,td[data-skip='true'],td[data-parent]").length},_findColAreaInLayout:function(col,nColArray,depth){var i,j,res={};for(i=0;i=array.length||at>array.length){return false}col=array.splice(start,length);for(n=0;ntargetColumn.start+targetColumn.length-1?movedColumn.start:nColArray.length; targetObject=this._findTargetRight(spStart,spEnd,j,nColArray);if(!targetObject){spStart=targetColumn.start+targetColumn.length-2;spEnd=movedColumn.start>targetColumn.start+targetColumn.length-1?-1:movedColumn.start+movedColumn.length;targetObject=this._findTargetLeft(spStart,spEnd,j,nColArray)}}else{spStart=targetColumn.start-1;spEnd=movedColumn.start>targetColumn.start+targetColumn.length-1?-1:movedColumn.start+movedColumn.length;targetObject=this._findTargetLeft(spStart,spEnd,j,nColArray);if(!targetObject){spStart=targetColumn.start+1;spEnd=movedColumn.start>targetColumn.start+targetColumn.length-1?movedColumn.start:nColArray.length;targetObject=this._findTargetRight(spStart,spEnd,j,nColArray)}}if(targetObject&&targetObject.pos&&targetObject.left!==undefined&&targetObject.left!==null){this._moveThs({from:header},cols,nColArray[targetObject.pos][j],targetObject.left)}}return rmil},_moveColumnInBodyFooter:function(area,movedColumn,targetColumn,after){var i,j,trs,$tr,tds,tar,skip=0,trsTo,$trTo,children,len,areaFrom=area.from||area;trs=area.trsFrom||areaFrom.find(">tr:not([data-container='true'],[data-grouprow='true'])");if(area.to||area.trsTo){trsTo=area.trsTo||area.to.find(">tr:not([data-container='true'],[data-grouprow='true'])")}if(trs.length>0&&!area.ignoreDataSkip){skip=trs.eq(0).find("[data-parent],[data-skip='true'],th").length}len=trs.length;for(j=0;j=0&&i=0&&i>end&&itr[data-role]");if(spTrs.length>0){skip=spTrs.eq(0).find("[data-parent],[data-skip='true']").length}for(j=0;joldVirtualColumnCount){self._attachColumn(col)}columnNumberChanged=true;self._resetVirtualDom()}});if(hasColumnVirtualization){this._vheaders=undefined;this._updateVirtualHorizontalScrollbar();this._onVirtualHorizontalScroll();if(!this._initialized){this._adjustLastColumnWidth(true)}}this._renderVirtualRecords()}}if(!hasVirtualization||isContinuos){$.each(columns,function(index,col){var pos;col.hidden=hidden;self._visibleColumnsArray=undefined;if(col.hidden){pos=self._detachColumn(col);self.element.find("colgroup>col").not("[data-skip]").eq(pos).attr("data-hiding",true)}else{self._attachColumn(col);$('').width(col.width).appendTo(self.element.find("colgroup"))}});if(this._isHierarchicalGrid){this.element.children("tbody").children("tr[data-container]").children().remove()}this._cleanupTBody();if(this.hasFixedColumns()){this._rerenderColgroups()}columnNumberChanged=true;if(hasVirtualization){this._updateVirtColCounters();if(this._initialized){this._renderVirtualRecords()}}else{this._renderRecords()}self.element.find("colgroup>col[data-showing]").remove();self.element.find("colgroup>col[data-hiding]").removeAttr("data-hiding")}if(columnNumberChanged){if(!this._initialized){if(this._visibleColumns().length===0){throw new Error(this._getLocaleValue("allColumnsHiddenOnInitialization"))}this._rerenderColgroups(initial);this._adjustLastColumnWidth(true);if(hasVirtualization){this._renderVirtualRecords()}}else{if(this._visibleColumns().length>0){this._rerenderColgroups(initial);this._adjustLastColumnWidth(true);visibleColumnsLength=this._visibleColumns().length;visibleColumnsWithWidthLength=$.grep(this._visibleColumns(),function(col){return col.width}).length;if(visibleColumnsWithWidthLength===visibleColumnsLength){if(this.options.width&&parseInt(this.options.width,10)>0){this._updateGridContentWidth()}else{this._setContainerWidth(this.container());if(hasVirtualization){gridWidth=this._calculateContainerWidth(true);if(this.options.height!==null){gridWidth-=this._scrollbarWidth()}this._vdisplaycontainer().css("width",gridWidth).css("max-width",gridWidth)}}}}}}this.element.trigger("iggriduisoftdirty",{owner:this});this._trigger(this.events.columnsCollectionModified,null,{owner:this});if(columnNumberChanged&&hasVirtualization&&this._visibleColumns().length>0&&visibleColumnsWithWidthLength===visibleColumnsLength){if(this.options.virtualizationMode==="continuous"){if(!isNaN(gridWidth)){gridWidth+=this._calculateSpecialColumnsWidth();this._vdisplaycontainer().css("width",gridWidth).css("max-width",gridWidth)}}if(!isNaN(gridWidth)){this.container().find("#"+this.id()+"_virtualContainer>colgroup col").eq(0).attr("width",gridWidth)}if(this.options.width===null||this.options.width===undefined){this._setContainerWidth(this.container().find("#"+this.id()+"_headers_v"))}}this._origWidth=parseInt(this.container().css("width"),10);if(columnNumberChanged&&$.ig.util.isSafari&&this.options.showHeader){self.headersTable().find("[data-header-row]").hide();self.fixedHeadersTable().find("[data-header-row]").hide();setTimeout(function(){self.headersTable().find("[data-header-row]").show();self.fixedHeadersTable().find("[data-header-row]").show();if(self.options.height){self._initializeHeights()}},0)}if(columnNumberChanged&&($.ig.util.isFF||$.ig.util.isIE8)){inPerc=this.options.width===null||typeof this.options.width==="string"&&this.options.width.indexOf("%")!==-1;if(inPerc){if($.ig.util.isIE8){this._refreshUI()}this._refreshTableUI(this.element);if(this.options.showHeader){this._refreshTableUI(this.headersTable())}if(this.options.fixedFooters===true&&this.options.height!==null){this._refreshTableUI(this.footersTable())}}}if(columnNumberChanged){this._checkAndReinitializeContainersHeights()}this._fireInternalEvent("_hidingFinished",{columns:columns,hidden:hidden})},_refreshTableUI:function($tbl){if(!$tbl.length){return}var overflow;overflow=$tbl[0].style.overflow;$tbl[0].style.overflow="hidden";setTimeout(function(){$tbl[0].style.overflow=overflow},0)},_checkAndReinitializeContainersHeights:function(initH){var c;if(_aNull(this.options.height)||!this.options.height||$.type(this.options.height)==="string"&&this.options.height.indexOf("%")>0){return}c=this.container();if(!c.length){return}if(_aNull(initH)){initH=c.height()}if(c[0].scrollHeight-initH>1){this._initializeHeights()}},_calculateSpecialColumnsWidth:function(){var width=0,cols=$();if(this.hasFixedColumns()&&this.fixingDirection()==="left"){cols=this.fixedHeadersTable().find("> colgroup > col[data-skip=true]")}this.headersTable().find("> colgroup > col[data-skip=true]").each(function(){cols=cols.add(this)});cols.each(function(){var colWidth=this.style.width;if(colWidth){width+=parseInt(colWidth,10)}});return width},_allSpecialColumnsInPercentage:function(){var specCols=this.headersTable().find("> colgroup > col[data-skip=true]"),i;for(i=0;i0){scrollContainer.scrollLeft(scrLeft);if(scrollContainer.scrollLeft()!==0||this.element.height()!==0){scrLeft=scrollContainer.scrollLeft();scroller.scrollLeft(scrLeft)}}else{$vContainer=this._vdisplaycontainer();if($vContainer.length){$vContainer.scrollLeft(scrLeft)}}if(hasFixedHeaders){headers=this.headersTable().parent();headers.scrollLeft(scrLeft)}if(hasFixedFooters){footers=this._fixedfooters();footers.scrollLeft(scrLeft)}},_updateGridContentWidth:function(){var gridWidth=0,hasWidthInPixels=this._gridHasWidthInPixels(),scroller,scrLeft,hasFixedHeader=this.options.height!==null&&this.options.fixedHeaders===true&&this.options.showHeader&&this._headerParent,colBreadth=this._isMultiRowGrid()&&this._rlp.length?this._rlp[0]:this._visibleColumns();$.each(colBreadth,function(index,e){var col=e.col||e;if(col.fixed===true){return true}if(gridWidth!==undefined&&col.width&&!(col.width.charAt&&col.width.endsWith("%"))){gridWidth+=parseInt(col.width,10)}else{gridWidth=undefined}});if(gridWidth===undefined){return}gridWidth+=this.hasFixedColumns()&&this.fixingDirection()==="left"?0:this._calculateSpecialColumnsWidth();if(!hasFixedHeader&&this._hasVerticalScrollbar&&(!hasWidthInPixels||hasWidthInPixels&&gridWidth<=parseInt(this.options.width,10))){gridWidth-=this._scrollbarWidth()}if(this.options.width!==null&&this.options.height!==null){scroller=this._hscrollbarcontent();scrLeft=scroller.scrollLeft()}this._setGridContentWidth(gridWidth);if(this.options.height!==null&&this.options.width!==null&&!this.options.virtualization&&!this.options.rowVirtualization&&!this.options.columnVirtualization){this._updateVerticalScrollbarCellPadding()}if(this.options.width!==null&&this.options.height!==null){scroller.scrollLeft(scrLeft);this._synchronizeHScroll()}},_updateVerticalScrollbarCellPadding:function(skipHeaderFooters){var o=this.options,hasFixedHeaders=o.showHeader&&o.fixedHeaders===true&&o.height!==null,hasFixedFooters=o.showFooter&&o.fixedFooters===true&&o.height!==null,hasVirtualization=o.virtualization===true||o.columnVirtualization===true||o.rowVirtualization===true,skipCheck=!hasVirtualization&&o.height&&(!hasFixedFooters||!hasFixedHeaders)&&this.hasFixedColumns()&&this.fixingDirection()==="right",emptySpace,paddingIncrement;if(o.height===null){return}if(this._gridInnerWidth===undefined||this._gridContentWidth===undefined){emptySpace=0}else{emptySpace=this.element.closest("div").width()-this.element.width()}if(this._hasVerticalScrollbar||(o.virtualization||o.rowVirtualization)&&(typeof o.width==="string"&&o.width.indexOf("%")>0)){paddingIncrement=this._scrollbarWidth()}else{paddingIncrement=0}if(hasVirtualization||!skipCheck&&!hasFixedHeaders&&!hasFixedFooters&&!(emptySpace>=0&&emptySpace=0?emptySpace:0;paddingIncrement=paddingIncrement<0?0:paddingIncrement;this._updateVScrollbarCellPaddingHelper(paddingIncrement,skipHeaderFooters);return paddingIncrement},_updateVScrollbarCellPaddingHelper:function(paddingIncrement,skipHeaderFooters){var hasFixedFooters=this.options.showFooter&&this.options.fixedFooters===true&&this.options.height!==null;if(!skipHeaderFooters){if(this.options.showHeader&&this.options.height!==null){if(!this.options.fixedHeaders){this._increaseLastCellVScrollbarPadding(this.element,"thead","th",paddingIncrement)}else{this._increaseLastHeaderCellVScrollbarPadding(this.headersTable(),paddingIncrement)}}if(hasFixedFooters){this._increaseLastCellVScrollbarPadding(this.footersTable(),"tfoot","td",paddingIncrement)}else{this._increaseLastCellVScrollbarPadding(this.element,"tfoot","td",paddingIncrement)}}this._increaseLastCellVScrollbarPadding(this.element,"tbody","td",paddingIncrement)},_getLastCellsInMCH:function(headerTable){var $thead,ml=this._maxLevel,$tr,lastCells=$(),i,$th,rowspan;if(!headerTable){headerTable=this.headersTable()}$thead=headerTable.find("thead");if(!ml||!$thead.length){return lastCells}for(i=ml;i>=0;i--){$tr=$thead.children("tr[data-mch-level="+i+"]");if(!$tr.length){continue}$th=$tr.children("th:last-child").not("[data-skip=true]");lastCells=lastCells.add($th);rowspan=parseInt($th.attr("rowspan"),10);if(!isNaN(rowspan)&&rowspan>1){i-=rowspan-1}}lastCells=lastCells.add($thead.children("tr:not([data-mch-level])").not("[data-skip=true]").children("th:last-child").not("[data-skip=true]"));return lastCells},_increaseLastHeaderCellVScrollbarPadding:function(table,paddingIncrement){var lastCells,currIncrement,paddingValue,selector="",i=0,updateNonPaddedInd=false;if(this._isMultiColumnGrid){updateNonPaddedInd=true;lastCells=this._getLastCellsInMCH(table)}else if(this._isMultiRowGrid()){for(i=0;i tr > th"+withoutLastCell+"[data-vscr-padding-icrement],thead > tr > td:not(:last)[data-vscr-padding-icrement]").removeAttr("data-vscr-padding-icrement").css(this._padding,"")},_removeCellPadding:function(table,tableGroup,rowElement,removeAllPaddings){var i,$cell,cells,withoutLastCell=":not(:last)";if(removeAllPaddings===true){withoutLastCell=""}cells=table.find(" > "+tableGroup+" > tr:first > "+rowElement+withoutLastCell+"[data-vscr-padding-icrement]");for(i=0;i "+tableGroup+" > tr > "+rowElement+":nth-child("+($cell.index()+1)+")").css(this._padding,"")}},_increaseLastCellVScrollbarPadding:function(table,tableGroup,rowElement,paddingIncrement){var paddingValue,lastCells=table.find(" > "+tableGroup+" > tr > "+rowElement+":last-child"),currIncrement=parseInt(lastCells.first().attr("data-vscr-padding-icrement"),10),i=0,cell;if(this._isMultiRowGrid()){lastCells=[];for(i=0;i0){lastCells=lastCells.concat(cell.toArray())}}lastCells=$(lastCells);currIncrement=parseInt(lastCells.first().attr("data-vscr-padding-icrement"),10)}this._removeCellPadding(table,tableGroup,rowElement);paddingValue=parseInt(lastCells.first().css(this._padding),10);paddingValue=paddingValue||0;if(currIncrement){paddingValue-=currIncrement}lastCells.css(this._padding,paddingValue+paddingIncrement);lastCells.first().attr("data-vscr-padding-icrement",paddingIncrement)},_updateHScrollbarVisibility:function(){var o=this.options,hasColVirt=o.columnVirtualization===true,$hScrollCntnrInner=this._getHScrollContainerInner(),scrollerContainer=this._hscrollbar(),visibleScroller=scrollerContainer.is(":visible"),gridW=this._gridInnerWidth,contW=this._gridContentWidth,shouldInitHeights=false,self=this;if(!scrollerContainer.length&&(hasColVirt||o.virtualizationMode==="continuous")){scrollerContainer=this._vhorizontalcontainer();visibleScroller=scrollerContainer.is(":visible")}scrollerContainer.css("display","");if(!scrollerContainer.is(":visible")&&scrollerContainer.length>0){scrollerContainer.css("display","none");return}if(o.rowVirtualization||o.virtualization){gridW=this.element.parent().width();if($.ig.util.isIE&&this._allColumnWidthsInPixels){contW=0;this.element.find(">colgroup>col").each(function(i,col){var w=col.width||col.style.width;if(w&&w.indexOf("px")>0){contW+=parseInt(w,10)}else{contW=self.element.width();return false}})}else{contW=this.element.width()}}if(gridW0)&&!this._allColumnWidthsInPercentage&&!this._allColumnWidthsInPixels){scrollerContainer.css("display","none")}}}else{if(o.virtualizationMode==="continuous"&&scrollerContainer.length===0&&$hScrollCntnrInner.length){this._vhorizontalcontainer().empty().attr("style","");shouldInitHeights=true}scrollerContainer.css("display","none")}if(hasColVirt){scrollerContainer.css("display","");shouldInitHeights=!visibleScroller}shouldInitHeights=shouldInitHeights||scrollerContainer.is(":visible")!==visibleScroller;if(o.autoAdjustHeight&&shouldInitHeights){this._initializeHeights()}},_applyAutofitLastColInVirtGrid:function(gridContentWidth){var o=this.options,widthInPerc,widthInPx;if(!o.rowVirtualization||o.columnVirtualization||o.autofitLastColumn){return true}gridContentWidth=gridContentWidth||this._gridContentWidth;widthInPx=this._gridHasWidthInPixels()&&gridContentWidth0,wWithoutScrlbr=width,hScrollbarVisible=this._hscrollbar().length?this._hscrollbar().is(":visible"):this._vhorizontalcontainer().is(":visible");if(hasFixedCols&&!widthInPerc){widthUnfixedContainer=parseInt(width,10)-this.fixedBodyContainer().outerWidth()}wWithoutScrlbr=widthInPerc?width:parseInt(widthUnfixedContainer,10)-scrlbWidth;this.container().css("width",width);this.element.css("width",widthInPerc?"100%":wWithoutScrlbr);if(this.options.fixedHeaders){this.headersTable().css("width",widthInPerc?"100%":widthUnfixedContainer)}this.container().find("#"+id+"_headers_v").css("max-width","").css("width",widthInPerc?"100%":widthUnfixedContainer);this._vdisplaycontainer().css("max-width","").css("width",widthInPerc?"100%":wWithoutScrlbr);this._virtualcontainer().css("width",widthInPerc?"100%":widthUnfixedContainer);cols=this._virtualcontainer().find("> colgroup > col");$col=hasFixedCols&&this.fixingDirection()==="left"?cols.eq(1):cols.first();$col.attr("width",widthInPerc?"100%":wWithoutScrlbr);this.container().find("#"+id+"_footer_container").css("max-width","").css("width",widthInPerc?"100%":widthUnfixedContainer);this.container().find("#"+id+"_footers").css("max-width","").css("width",widthInPerc?"100%":widthUnfixedContainer);this._vhorizontalcontainer().css("width",widthInPerc?"100%":$.ig.util.isFF?parseFloat(widthUnfixedContainer)-scrlbWidth:widthUnfixedContainer);if(this.options.autofitLastColumn&&!(hasFixedCols&&this.fixingDirection()==="right")){this._rerenderColgroups();this._adjustLastColumnWidth(true)}this._gridInnerWidth=this._vdisplaycontainer().width();if(this._allColumnWidthsInPixels&&widthInPerc){if(this.options.fixedHeaders){this.headersTable().css("max-width",this._gridInnerWidth)}this.element.css("max-width",this._gridInnerWidth);if(this.options.fixedFooters){this.footersTable().css("max-width",this._gridInnerWidth)}}this._updateGridContentWidth();if(hScrollbarVisible!==this._vhorizontalcontainer().is(":visible")){this._rerenderColgroups();this._updateGridContentWidth()}},_setGridWidth:function(width){if(this.options.virtualization===true||this.options.columnVirtualization===true||this.options.rowVirtualization===true){return this._setGridWidthVirtGrid(width)}var widthUnfixedContainer=width,hasFixedCols=this.hasFixedColumns(),widthInPerc=typeof width==="string"&&width.indexOf("%")>0;if(hasFixedCols&&width&&!widthInPerc){widthUnfixedContainer=parseInt(width,10)-this.fixedBodyContainer().outerWidth()}else if(widthInPerc){widthUnfixedContainer="100%"}this.container().css("width",width);this.element.css("width",widthUnfixedContainer);if(this.options.fixedHeaders){this.headersTable().css("width",widthInPerc?"100%":width)}if(this.options.fixedFooters){this.footersTable().css("width",widthInPerc?"100%":width)}if(!this._allColumnWidthsInPercentage||!widthInPerc){this._gridInnerWidth=this.scrollContainer().width()}if(this.options.autofitLastColumn&&!(hasFixedCols&&this.fixingDirection()==="right")){this._rerenderColgroups();this._adjustLastColumnWidth(true)}if(this.options.width!==null||this.options.height!==null){this._updateGridContentWidth()}},_setGridContentWidth:function(gridContentWidth){var o=this.options,w,$hscrlbar,$parent,oAvgRowHeight,fixedCols=this.hasFixedColumns(),fixedDirRight=this.fixingDirection()==="right",v=o.virtualization===true||o.rowVirtualization===true||o.columnVirtualization===true;if(v===false||o.rowVirtualization&&!this._applyAutofitLastColInVirtGrid(gridContentWidth)){this._setGridTablesWidth(gridContentWidth);if(v){this._avgRowHeight=this._calculateAvgRowHeight();if(oAvgRowHeight!==this._avgRowHeight){this._trigger("avgRowHeightChanged",null,{owner:this,oAvgRowHeight:null,avgRowHeight:this._avgRowHeight})}}}else{this._checkAndSetTableWidths()}if(this.options.height!==null){this._gridContentWidth=gridContentWidth||this._gridContentWidth;if(this._gridContentWidth){w=(this._hasVerticalScrollbar||this.options.rowVirtualization||this.options.virtualizationMode==="continuous"&&this.options.virtualization)&&!v&&!(fixedCols&&fixedDirRight)&&this.options.fixedHeaders?this._gridContentWidth-this._scrollbarWidth():this._gridContentWidth;$hscrlbar=this._getHScrollContainerInner();if(!v&&!$hscrlbar.length){$parent=this.element.parent();this._addHorizontalScrollBar($parent); if($parent.css("overflow-x")!=="hidden"){$parent.css("overflow-x","hidden")}$hscrlbar=this._getHScrollContainerInner()}w=v&&!$.ig.util.isIE?this.element.width()||w:w;$hscrlbar.css("width",w)}this._updateHScrollbarVisibility()}},_checkAndSetTableWidths:function(){var o=this.options,w,func;func=function(tbl,w){if(!tbl.length){return}var tblw=tbl[0].style.width;if(!tblw||tblw.indexOf("%")>0){return null}if(!w){w=0;tbl.find(">colgroup>col").each(function(ind,col){var cw=col.width||col.style.width;if(!cw||cw.indexOf&&cw.indexOf("%")>0){w=0;return false}w+=parseInt(cw,10)})}if(w){tbl[0].style.width=w+"px"}return w};if(o.showHeader&&o.fixedHeaders&&o.height!==null){w=func(this.headersTable())}func(this.element,w);if(o.showFooter&&o.fixedFooters===true&&o.height!==null){func(this.footersTable(),w)}},_setGridTablesWidth:function(width){var hasFixedHeaders=this.options.showHeader&&this.options.fixedHeaders===true&&this.options.height!==null,hasFixedFooters=this.options.showFooter&&this.options.fixedFooters===true&&this.options.height!==null;this.element.css("width",width);if(hasFixedHeaders){this.headersTable().css("width",width)}if(hasFixedFooters){this.footersTable().css("width",width)}},_detachHiddenColumns:function(){var col,i;for(i=0;i tr"),$tr,position=-1,cells=[];for(i=0;i0){for(i=0;i tr").find("th[data-mch-id="+parent.identifier+"]")}colspan=parseInt($th.attr("colspan"),10);if(colspan>1){$th.attr("colspan",--colspan);parent.colspan=colspan}else{$tr=$th.closest("tr");if($tr[0].style.height===""){$tr[0].style.height=$tr.outerHeight()+"px"}$th.attr("ishidden",1);$th.css("display","none");parent.hidden=true;parent.colspan=0}}}},_detachCells:function(rows,cellSelectorFunction,position,container,key){var detachedCells=[],i,cells,currentCell;if(rows.length>0){for(i=0;i").attr("data-hiddenreplacement","true").css("height",currentCell.height()).attr("class",currentCell.attr("class")))}detachedCells.push(currentCell.detach())}container[key]=detachedCells}},_showMultiHeaderCells:function(key){var i,currentCell=this._hiddenColumns[key],parents=this._getParentsMultiHeader(key),parent,colspan,$th,currentOrder,order,headerCellsLength=this._headerCells.length,headersTable=this.headersTable().find("thead > tr"),isHidden;if(currentCell===null||currentCell===undefined){return}currentOrder=currentCell.data("data-mch-order");for(i=0;i0){for(i=0;i tr").find("th[data-mch-id="+parent.identifier+"]")}isHidden=$th.attr("ishidden")==="1";colspan=parseInt($th.attr("colspan"),10);if(!isHidden){$th.attr("colspan",++colspan);parent.colspan=colspan}else{$th.removeAttr("ishidden");$th.css("display","");parent.hidden=false;parent.colspan=1}}}},_attachCells:function(rows,cellSelectorFunction,position,container,key){var detachedCells,i,cells,replacementCell,storedKey;if(rows.length>0){if(this.options.virtualization===true||this.options.columnVirtualization===true){detachedCells=container[key];if(detachedCells===null||detachedCells===undefined){for(storedKey in container){if(container.hasOwnProperty(storedKey)){detachedCells=container[storedKey];delete container[storedKey];break}}}else{delete container[key]}}else{detachedCells=container[key];delete container[key]}if(detachedCells===undefined||detachedCells===null){return}for(i=0;i