/*!@license * Infragistics.Web.ClientUI Data Binding Plugin 19.1.20 * * Copyright (c) 2011-2019 Infragistics Inc. * * igDataSource provides the following functionality: * - read and parse local XML , JSON , and HTML data * - normalize / transform the above data according to a schema * - data type conversion (date, string, number, etc.) * - define relationships between two and more flat data sources - with primary/foreign keys, etc * - build URL params for requests that get remote data * - in case of scenarios such as paging, understand and prase the response - expect that it's in a predefined format that can be additionall configured by the developer * - get data from WCF services * - ability to combine local with remote functionality * - queueing AJAX requests * paging,filtering (searching), and sorting functionality that are control-independent are also implemented here * the idea of this code is to serve as a data-source abstraction layer (client-side data source control) * that may well be used by all other client-side controls , such as dropdown, tree, menu, etc. * * http://www.infragistics.com/ * * Depends on: * jquery-1.9.1.js * infragistics.util.js * infragistics.util.jquery.js * */ (function(factory){if(typeof define==="function"&&define.amd){define(["jquery","./infragistics.util","./infragistics.util.jquery"],factory)}else{return factory(jQuery)}})(function($){/*!@license * Infragistics.Web.ClientUI data source 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.DataSourceLocale=$.ig.DataSourceLocale||{};$.ig.locale.en.DataSourceLocale={invalidDataSource:"The supplied data source is invalid. It happens to be a scalar.",unknownDataSource:"Cannot determine the data source type. Please specify if it is JSON or XML data.",errorParsingArrays:"There was an error parsing the array data and applying the defined data schema: ",errorParsingJson:"There was an error parsing the JSON data and applying the defined data schema: ",errorParsingXml:"There was an error parsing the XML data and applying the defined data schema: ",errorParsingHtmlTable:"There was an error extracting the data from the HTML Table and applying the schema : ",errorExpectedTbodyParameter:"Expected a tbody or a table as a parameter.",errorTableWithIdNotFound:"The HTML Table with the following ID was not found: ",errorParsingHtmlTableNoSchema:"There was an error parsing the Table DOM: ",errorParsingJsonNoSchema:"There was an error parsing/evaluating the JSON string: ",errorParsingXmlNoSchema:"There was an error parsing the XML string: ",errorXmlSourceWithoutSchema:"The supplied data source is an xml document, but there is no defined data schema ($.IgDataSchema) ",errorUnrecognizedFilterCondition:" The filter condition that was passed was not recognized: ",errorRemoteRequest:"The remote request to fetch data has failed: ",errorSchemaMismatch:"The input data doesn't match the schema, the following field couldn't be mapped: ",errorSchemaFieldCountMismatch:"The input data doesn't match the schema in terms of number of fields. ",errorUnrecognizedResponseType:"The response type was either not set correctly, or it was not possible to detect it automatically. Please set settings.responseDataType and/or settings.responseContentType.",hierarchicalTablesNotSupported:"Tables are not supported for HierarchicalSchema",cannotBuildTemplate:"The jQuery template could not be built. There are no records present in the data source, and no columns defined.",unrecognizedCondition:"Unrecognized filtering condition in the following expression: ",fieldMismatch:"The following expression contains an invalid field or filtering condition: ",noSortingFields:"There are no fields specified. You need to specify at least one field to sort by, when calling sort().",filteringNoSchema:"There is no schema / fields specified. You need to specify a schema with field definitions and types to be able to filter the data source.",noSaveChanges:"Saving changes was not successful. Server did not return Success object or returned Success:false.",errorUnexpectedCustomFilterFunction:"An unexpected value was provided for a custom filtering function. A function or string is expected."};$.ig.DataSourceLocale.locale=$.ig.DataSourceLocale.locale||$.ig.locale.en.DataSourceLocale;return $.ig.locale.en.DataSourceLocale})($);$.ig=$.ig||{};if(!window.Infragistics){window.Infragistics=$.ig}$.ig.DataSource=$.ig.DataSource||Class.extend({settings:{id:"ds",outputResultsName:null,callback:null,callee:null,data:[],dataSource:null,dataBinding:null,dataBound:null,requestType:"GET",type:"unknown",schema:null,primaryKey:null,responseTotalRecCountKey:null,responseDataKey:null,responseDataType:null,responseContentType:null,localSchemaTransform:true,urlParamsEncoding:null,urlParamsEncoded:null,paging:{enabled:false,type:"remote",pageSize:5,pageSizeUrlKey:null,pageIndexUrlKey:null,pageIndex:0,appendPage:false},filtering:{type:"remote",caseSensitive:false,applyToAllData:true,customFunc:null,filterExprUrlKey:null,filterLogicUrlKey:"filterLogic",defaultFields:[],expressions:[],exprString:"",customConditions:null},sorting:{defaultDirection:"none",defaultFields:[],applyToAllData:true,customFunc:null,compareFunc:null,customConvertFunc:null,type:"remote",caseSensitive:false,sortUrlKey:null,sortUrlAscValueKey:null,sortUrlDescValueKey:null,expressions:[],exprString:""},groupby:{defaultCollapseState:false,groupRecordKey:"__gbRecord",groupSummaryRecordKey:"__gbSummaryRecord",summaries:[],summariesPosition:"bottom",pagingMode:"allRecords"},summaries:{type:"remote",summaryExprUrlKey:"summaries",summariesResponseKey:"summaries",summaryExecution:"afterfilteringandpaging",columnSettings:[]},fields:[],serializeTransactionLog:true,aggregateTransactions:false,autoCommit:false,updateUrl:null,rowAdded:null,rowUpdated:null,rowInserted:null,rowDeleted:null},init:function(options){var tempSource,tempCallee,arrayAlready=false,metadata;if(options){tempSource=options.dataSource;if(tempSource&&($.type(tempSource)==="array"||$.type(tempSource)==="object")){if($.type(tempSource)==="object"&&options.responseDataKey&&options.type!=="json"){metadata=tempSource.Metadata;options.dataSource=$.ig.findPath(tempSource,options.responseDataKey);if(metadata&&options.dataSource.Metadata===undefined){options.dataSource.Metadata=metadata}arrayAlready=true}else{options.dataSource=null}}if(options.callee){tempCallee=options.callee;options.callee=null}this.settings=$.extend(true,{},$.ig.DataSource.prototype.settings,options);if(arrayAlready){this.settings.type="array"}else if(tempSource&&($.type(tempSource)==="array"||$.type(tempSource)==="object")){options.dataSource=tempSource;this.settings.dataSource=tempSource}if(tempCallee){this.settings.callee=tempCallee;tempCallee=null}}this.settings.paging.pageIndex=0;this._isBound=false;this._url=null;this._dsCallback=null;this._data=[];this._dataView=[];if(this.settings.type==="unknown"){this._runtimeType=this.analyzeDataSource()}else{this._runtimeType=this.settings.type}this._parser=new $.ig.TypeParser;this._schema=null;this._isSortingReq=false;this._isFilteringReq=false;this._isPagingReq=false;this._isSummariesReq=false;this._dataSummaries=[];this._recCount=0;this._hasCount=false;this._initSchema();this._transactionLog=[];this._accumulatedTransactionLog=[];return this},_initSchema:function(){var i;if(this.settings.schema){if(this.settings.schema instanceof $.ig.DataSchema){this._schema=this.settings.schema}else{if(this.settings.type!=="unknown"){this._schema=new $.ig.DataSchema(this.settings.type,this.settings.schema)}else{this._schema=new $.ig.DataSchema(this._runtimeType,this.settings.schema)}this._schema._pk=this.settings.primaryKey}this._fields={};for(i=0;i0&&ds.toLowerCase().startsWith("