UNPKG

@types/ignite-ui

Version:
1,297 lines (1,109 loc) 4.31 MB
interface DataSourceSettingsPaging { /** * Paging is not enabled by default */ enabled?: boolean | undefined; /** * Type for the paging operation * * Valid values: * "local" Data is paged client-side. * "remote" A remote request is done and URL params encoded */ type?: string | undefined; /** * Number of records on each page */ pageSize?: number | undefined; /** * Denotes the name of the encoded URL parameter that will state what is the currently requested page size */ pageSizeUrlKey?: string | undefined; /** * Denotes the name of the encoded URL parameter that will state what is the currently requested page index */ pageIndexUrlKey?: string | undefined; /** * Current page index */ pageIndex?: number | undefined; /** * Whether when a new page of data is requested we should append the new data to the existing data */ appendPage?: boolean | undefined; /** * Option for DataSourceSettingsPaging */ [optionName: string]: any; } interface DataSourceSettingsFiltering { /** * Filtering type. * * Valid values: * "remote" Parameters will be encoded and it's up to the backend to interpred them from the response. * "local" The data will be filtered automatically client-side */ type?: string | undefined; /** * Enables or disables case sensitive filtering on the data. Works only for local filtering */ caseSensitive?: boolean | undefined; /** * If the type of paging/sorting/filtering is local and applyToAllData is true, filtering will be performed on the whole data source that's present locally, otherwise only on the current dataView. if type is remote, this setting doesn't have any effect. */ applyToAllData?: boolean | undefined; /** * Can point to either a string or a function object. The parameters that are passed are 1) the data array to be filtered, 2) the filtering expression definitions. Should return an array of the filtered data */ customFunc?: any; /** * Url key that will be encoded in the request if remote filtering is performed. Default value of null implies OData-style URL encoding. Please see http://www.odata.org/developers/protocols/uri-conventions for details */ filterExprUrlKey?: string | undefined; /** * Url key that will be encoded in the request, specifying if the filtering logic will be AND or OR */ filterLogicUrlKey?: string | undefined; /** * Data will be initially filtered accordingly, directly after dataBind() */ defaultFields?: any[] | undefined; /** * A list of expression objects, containing the following key-value pairs: fieldName, expression (search string), condition , and logic (AND/OR) */ expressions?: any[] | undefined; /** * An "SQL-like' encoded expressions string. Takes precedence over "expressions". Example: col2 > 100; col2 LIKE %test% */ exprString?: string | undefined; /** * An object containing custom defined filtering conditions as objects. */ customConditions?: any; /** * Option for DataSourceSettingsFiltering */ [optionName: string]: any; } interface DataSourceSettingsSorting { /** * Sorting direction * * Valid values: * "none" * "asc" * "desc" */ defaultDirection?: string | undefined; /** * When defaultDirection is different than "none", and defaultFields is specified, data will be initially sorted accordingly, directly after dataBind() */ defaultFields?: any[] | undefined; /** * If the sorting type is local and applyToAllData is true, sorting will be performed on the whole data source that's present locally, otherwise only on the current dataView. If sorting type is remote, this setting doesn't have any effect. */ applyToAllData?: boolean | undefined; /** * Custom sorting function that can point to either a string or a function object. When the function is called, the following arguments are passed: data array, fields (array of field definitions) , direction ("asc" or "desc"). The function should return a sorted data array */ customFunc?: any; /** * Custom comparison sorting function. Accepts the following arguments: fields, schema, booleand value whether sorting is ascending , convert function(please check option for customConvertFunc) and returns a value 0 indicating that values are equal, 1 indicating that val1 > val2 and -1 indicating that val1 < val2 */ compareFunc?: any; /** * Custom data value conversion function(called from sorting function). Accepts a value of the data cell and column key and should return the converted value */ customConvertFunc?: any; /** * Specifies whether sorting will be applied locally or remotely (via a remote request) * * Valid values: * "remote" * "local" */ type?: string | undefined; /** * Specifies if sorting will be case sensitive or not. Works only for local sorting */ caseSensitive?: boolean | undefined; /** * URL param name which specifies how sorting expressions will be encoded in the URL. Default is null and uses OData conventions */ sortUrlKey?: string | undefined; /** * URL param value for ascending type of sorting. Default is null and uses OData conventions */ sortUrlAscValueKey?: string | undefined; /** * URL param value for descending type of sorting. Default is null and uses OData conventions */ sortUrlDescValueKey?: string | undefined; /** * A list of sorting expressions , consisting of the following keys (and their respective values): fieldName, direction and compareFunc (optional) */ expressions?: any[] | undefined; /** * Takes precedence over experssions, an "SQL-like" encoded expressions string : see sort(). Example col2 > 100 ORDER BY asc */ exprString?: string | undefined; /** * Option for DataSourceSettingsSorting */ [optionName: string]: any; } interface DataSourceSettingsGroupby { /** * Default collapse state */ defaultCollapseState?: boolean | undefined; /** * The name of the property that determines whether a record from the group data view is a group record. */ groupRecordKey?: string | undefined; /** * The name of the property that determines whether a record from the group data view is a summary group record. */ groupSummaryRecordKey?: string | undefined; /** * Array of objects containing the summaries for each field. * Each summary object has the following format { field:"fieldName", summaryFunctions: [] }, where the summaryFunctions arrays can contain either a summary name (avg, sum, count etc.) or a custom function for caclulating a custom summary. */ summaries?: any[] | undefined; /** * Specifies the postion for the summaries for each field inside each group. * * Valid values: * "top" One summary row will be displayed at the top for each group * "bottom" One summary row will be displayed at the bottom for each group * "both" Two summary rows will be be display for each group. One on the top and one on the bottom. */ summariesPosition?: string | undefined; /** * . Specifies how paging should be applied when there is at least one grouped column * * Valid values: * "allRecords" Paging is applied for all records - data and non-data records(like group-by records) * "dataRecordsOnly" Paging is applied ONLY for data records. Non-data records are disregarded in paging calculations. */ pagingMode?: string | undefined; /** * Option for DataSourceSettingsGroupby */ [optionName: string]: any; } interface DataSourceSettingsSummaries { /** * Specifies whether summaries will be applied locally or remotely (via a remote request) * * Valid values: * "remote" A remote request is done and URL params encoded * "local" Data is paged client-side. */ type?: string | undefined; /** * Url key for retrieving data from response - used only when summaries are remote */ summaryExprUrlKey?: string | undefined; /** * Key for retrieving data from the summaries response - used only when summaries are remote */ summariesResponseKey?: string | undefined; /** * Determines when the summary values are calculated * * Valid values: * "priortofilteringandpaging" * "afterfilteringbeforepaging" * "afterfilteringandpaging" */ summaryExecution?: string | undefined; /** * A list of column settings that specifies custom summaries options per column basis */ columnSettings?: any[] | undefined; /** * Option for DataSourceSettingsSummaries */ [optionName: string]: any; } interface DataSourceSettings { /** * Setting this is only necessary when the data source is set to a table in string format. we need to create an invisible dummy data container in the body and append the table data to it */ id?: string | undefined; /** * This is the property in the dataView where actual resulting records will be put. (So the dataView will not be array but an object if this is defined), after the potential data source transformation */ outputResultsName?: string | undefined; /** * Callback function to call when data binding is complete */ callback?: Function | undefined; /** * Object on which to invoke the callback function */ callee?: any; /** * This is the normalized (transformed) resulting data, after it's fetched from the data source */ data?: any[] | undefined; /** * This is the source of data - non normalized. Can be an array, can be reference to some JSON object, can be a DOM element for a HTML TABLE, or a function */ dataSource?: any; /** * Client-side dataBinding event. Can be a string pointing to a function name, or an object pointing to a function */ dataBinding?: any; /** * Client-side dataBound event. Can be a string pointing to a function name, or an object pointing to a function */ dataBound?: any; /** * Specifies the HTTP verb to be used to issue the request */ requestType?: string | undefined; /** * Type of the data source * * Valid values: * "json" Specifies that the data source is an already evaluated JSON (JavaScript object/array) or a string that can be evaluated to JSON * "xml" Specifies that the data source is a XML Document object or a string that can be evaluated to XML * "unknown" Specifies that the data source is of unknown type. In that case it will be analyzed and automatically detected if possible * "array" Specifies that the data source is a simple array of objects. * "function" Specifies that the data source points to a function. During data binding the function will be called and the result will be assumed to be an array of objects * "htmlTableString" Specifies that the data source points to a string that represents a HTML table * "htmlTableId" Specifies that the data source points to an ID of a HTML Table element that's loaded on the page * "htmlTableDom" The data source points to a DOM object that is of TABLE type * "invalid" Set whenever data source is analyzed (in case its type is unknown) and the type cannot be detected * "remoteUrl" Specifies that the data source points to a remote URL, from which data will be retrieved using an AJAX call ($.ajax) * "htmlListDom" The data source points to a DOM object that is of UL/OL type * "htmlSelectDom" The data source points to a DOM object that is of SELECT type * "empty" */ type?: string | undefined; /** * A schema object that defines which fields from the data to bind to */ schema?: any; /** * The unique field identifier */ primaryKey?: string | undefined; /** * Property in the response which specifies the total number of records in the backend (this is needed for paging) */ responseTotalRecCountKey?: string | undefined; /** * Property in the response which specifies where the data records array will be held (if the response is wrapped) */ responseDataKey?: string | undefined; /** * Response type when a URL is set as the data source. See http://api.jquery.com/jQuery.ajax/ => dataType * * Valid values: * "json" * "xml" * "html" * "script" * "jsonp" * "text" */ responseDataType?: string | undefined; /** * Content type of the response. See http://api.jquery.com/jQuery.ajax/ => contentType */ responseContentType?: string | undefined; /** * If set to false will disable transformations on schema, even if it is defined locally in the javascript code */ localSchemaTransform?: boolean | undefined; /** * Event that is fired before URL parameters are encoded. Can point to a function name or the function object itself */ urlParamsEncoding?: any; /** * Event that is fired after URL parameters are encoded (When a remote request is done). Can point to a function name or the function object itself */ urlParamsEncoded?: any; /** * Settings related to built-in paging functionality */ paging?: DataSourceSettingsPaging | undefined; /** * Settings related to built-in filtering functionality */ filtering?: DataSourceSettingsFiltering | undefined; /** * Settings related to built-in sorting functionality */ sorting?: DataSourceSettingsSorting | undefined; /** * Settings related to built-in group by functionality */ groupby?: DataSourceSettingsGroupby | undefined; /** * Settings related to built-in summaries functionality */ summaries?: DataSourceSettingsSummaries | undefined; /** * *** IMPORTANT DEPRECATED *** * A list of field definitions specifying the schema of the data source. * Field objects description: {name, [type], [xpath]} */ fields?: any[] | undefined; /** * If true, will serialize the transaction log of updated values - if any - whenever commit is performed via a remote request. */ serializeTransactionLog?: boolean | undefined; /** * If set to true, the following behavior will take place: * if a new row is added, and then deleted, there will be no transaction added to the log * if an edit is made to a row or cell, then the value is brought back to its original value, the transaction should be removed * Note: This option takes effect only when autoCommit is set to false. */ aggregateTransactions?: boolean | undefined; /** * If auto commit is true, data will be automatically commited to the data source, once a value or a batch of values are updated via saveChanges() */ autoCommit?: boolean | undefined; /** * Specifies an update remote URL, to which an AJAX request will be made as soon as saveChages() is called. */ updateUrl?: string | undefined; /** * A function to call when row is added. * Function takes first argument item and second argument dataSource. * Use item.row to obtain reference to the added row. * Use item.rowId to get the row ID. * Use dataSource to obtain reference to $.ig.DataSource. */ rowAdded?: Function | undefined; /** * A function to call when row is updated (edited). * Function takes first argument item and second argument dataSource. * Use item.rowIndex to get the row index. * Use item.newRow to obtain reference to the updated row. * Use item.oldRow to obtain reference to the row that was updated. * Use dataSource to obtain reference to $.ig.DataSource. */ rowUpdated?: Function | undefined; /** * A function to call when row is inserted. * Function takes first argument item and second argument dataSource. * Use item.row to obtain reference to the inserted row. * Use item.rowId to get the row ID. * Use item.rowIndex to get the row index. * Use dataSource to obtain reference to $.ig.DataSource. */ rowInserted?: Function | undefined; /** * A function to call when row is deleted. * Use item.row to obtain reference to the deleted row. * Use item.rowId to get the row ID. * Use item.rowIndex to get the row index. * Use dataSource to obtain reference to $.ig.DataSource. */ rowDeleted?: Function | undefined; /** * Option for DataSourceSettings */ [optionName: string]: any; } declare namespace Infragistics { class DataSource { constructor(settings: DataSourceSettings); /** * Sets a list of fields to the data source. If no parameter is specified, just returns the already existing list of fields * * @param fields a field has the following format: {key: 'fieldKey', dataType: 'string/number/date' } */ fields(fields?: Object): Object; /** * Analyzes the dataSource setting to automatically determine the type of the data source. Returns the data source type. See settings.type */ analyzeDataSource(): string; /** * Returns the current normalized/transformed and paged/filtered/sorted data, i.e. the dataView */ dataView(): any[]; /** * Returns all of the bound data, without taking into account local paging, sorting, filtering, etc. */ data(): Object; /** * Returns transformed data according to transformed execution: * 1. Before paging and filtering * 2. After filtering before paging * 3. After filtering and paging * * @param transformedExecution */ transformedData(transformedExecution: Object): Object; /** * Returns summaries data */ dataSummaries(): Object; /** * Gets/sets the schema definition. * * @param s a schema object * @param t type of the data source. See settings.type */ schema(s?: Object, t?: string): void; /** * Gets/sets a list of paging settings * * @param p object holding all paging settings. See settings.paging */ pagingSettings(p?: Object): Object; /** * Gets/sets a list of filtering settings * * @param f object holding all filtering settings. See settings.filtering */ filterSettings(f?: Object): void; /** * Gets/sets a list of paging settings * * @param s object holding all sorting settings. See settings.sorting */ sortSettings(s?: Object): Object; /** * Gets/sets a list of summaries settings. * * @param s object holding all summaries settings. See settings.summaries */ summariesSettings(s?: Object): void; /** * Gets/sets the dataSource setting. If no parameter is specified, returns settings.dataSource * * @param ds */ dataSource(ds?: Object): Object; /** * Gets/sets the type of the dataSource. If no parameter is specified, returns settings.type * * @param t * @return json|xml|unknown|array|function|htmlTableString|htmlTableId|htmlTableDom|invalid|remoteUrl|empty */ type(t?: Object): string; /** * Returns a record by a specified key (requires that primaryKey is set in the settings) * * @param key Primary key of the record * @param ds the data source in which to search for the record. When not set it will use the current data source. * @param objPath Not used in $.ig.DataSource */ findRecordByKey(key: Object, ds?: string, objPath?: string): Object; /** * Removes a specific record denoted by the primaryKey of the passed key parameter from the data source * * @param key primary key of the record * @param origDs */ removeRecordByKey(key: Object, origDs: Object): void; /** * Removes a record from the data source at specific index. * * @param index index of record * @param origDs */ removeRecordByIndex(index: number, origDs: Object): void; /** * Sets a cell value for the cell denoted by rowId and colId. Creates a transaction for the update operation and returns it * * @param rowId the rowId - row key (string) or index (number) * @param colId the column id - column key (string) or index (number) * @param val The new value * @param autoCommit if autoCommit is true, it updates the datasource automatically and the transaction is still stored in the accumulated transaction log */ setCellValue(rowId: Object, colId: Object, val: Object, autoCommit: boolean): Object; /** * Updates a record in the datasource. Creates a transaction that can be committed / rolled back * * @param rowId the record key - primaryKey (string) or index (number) * @param rowObject the record object containing the key/value pairs we want to update. It doesn't have to include key/value pairs for all fields defined in the schema or in the data source (if no schema is defined) * @param autoCommit if autoCommit is true, the datasource will be updated automatically and the transaction is still stored in the accumulated transaction log */ updateRow(rowId: Object, rowObject: Object, autoCommit: boolean): Object; /** * Adds a new row to the data source. Creates a transaction that can be committed / rolled back * * @param rowId the record key - primaryKey (string) or index (number) * @param rowObject the new record data. * @param autoCommit if autoCommit is true, the datasource will be updated automatically and the transaction is still stored in the accumulated transaction log */ addRow(rowId: Object, rowObject: Object, autoCommit: boolean): Object; /** * Adds a new row to the data source. Creates a transaction that can be committed / rolled back * * @param rowId the record key - primaryKey (string) or index (number) * @param rowObject the new record data. * @param rowIndex row index at which to insert the new row * @param autoCommit if autoCommit is true, the datasource will be updated automatically and the transaction is still stored in the accumulated transaction log * @param parentRowId Not used in $.ig.DataSource */ insertRow(rowId: Object, rowObject: Object, rowIndex: number, autoCommit: boolean, parentRowId: Object): Object; /** * Deletes a row from the data source. * * @param rowId the record key - primaryKey (string) or index (number) * @param autoCommit if autoCommit is true, the datasource will be updated automatically and the transaction is still stored in the accumulated transaction log */ deleteRow(rowId: Object, autoCommit: boolean): Object; /** * Adds a new node to the tree data source. Creates a transaction that can be committed / rolled back * * @param data the transaction data */ addNode(data: Object): void; /** * Removes a node from the tree data source. Creates a transaction that can be committed / rolled back * * @param data the transaction data */ removeNode(data: Object): void; /** * Returns a standalone object (copy) that represents the commited transactions, but detached from the data source * * @param t a transaction object */ getDetachedRecord(t: Object): Object; /** * Update the data source with every transaction from the log * * @param id Id of the transaction to commit. If no id is specified, will commit all transactions to the data source. */ commit(id?: number): void; /** * Clears the transaction log without updating anything in the data source * * @param id Record Id to find transactions for. If no id is specified, will rollback all transactions to the data source. */ rollback(id?: Object): void; /** * Returns a list of all transaction objects that are pending to be committed or rolled back to the data source */ pendingTransactions(): any[]; /** * Returns a list of all transaction objects that are either pending, or have been committed in the data source. */ allTransactions(): any[]; /** * Returns the accumulated transaction log as a string. The purpose of this is to be passed to URLs or used conveniently */ transactionsAsString(): string; /** * Posts to the settings.updateUrl using $.ajax, by serializing the changes as url params * * @param success Specifies a custom function to be called when AJAX request to the updateUrl option succeeds(optional) * @param error Specifies a custom function to be called when AJAX request to the updateUrl option fails(optional) */ saveChanges(success: Function, error: Function): void; /** * Data binds to the current data source * databinding works using the following workflow: * 1. fire the databinding event * 2. based on the data source type (see analyzeDataSource()), do the following: * 3. if type is HtmlTable, parse the table and set the data and dataView respectively. * if the type is Function, call it, apply Paging/Filtering/Sorting, and set this._dataView . If the developer wants to do his own paging, filtering or sorting * in that case, then he should handle the PageIndexChanging and/or DataFiltering, and/or ColumnSorting client-side events, and cancel them. * if no paging/sorting/filtering are enabled, use just this._data to save space * if the data source is of type RemoteUrl, use jQuery's $.ajax API to trigger a remote request to the service. Use the param() API to encode the URL * if the data source is invalid, throw an exception * if the analyzed runtime data source type , that is, the result of analyzeDataSource(), is Unknown, check if * the value of settings.type is set to XML or JSON. If string, eval for JSON, and parse for the XML to build the object tree * 4. now normalize/transform the data, if a schema is supplied. This inplies any additional data type conversion * 5. next, if OpType is Local, apply paging, sorting, and/or filtering to the data, and store the result in this._dataView * 6. fire the databound event * * @param callback callback function * @param callee callee object on which the callback will be executed. If none is specified, will assume global execution context */ dataBind(callback?: string, callee?: Object): void; /** * Gets a cell value from the record by the specified fieldName. If there's a mapper defined for the field, the resolved by the mapper value will be returned. * * @param fieldName the fieldName - name of the field * @param record the record from which to get it */ getCellValue(fieldName: string, record: Object): Object; /** * Applicable only when the data source is bound to remote data. * Gets or sets summaries data. * If key or dsObj are not set then returns summaries data. * Takes summary data from passed argument dsObj(using argument key) * * @param key response key to take summary data(for example "Metadata.Summaries") * @param dsObj data source object - usually contains information about data records and metadata(holds info about summaries) */ summariesResponse(key?: string, dsObj?: Object): Object; /** * Returns filtered data if local filtering is applied. If filtering is not applied OR type of filtering is remote returns undefined. */ filteredData(): any[]; /** * Sorts the data source locally. The result (filtered data) can be obtained by calling dataView(). * Remote filtering can be performed by just calling dataBind() and setting the settings.filtering.expressions * multi-column sorting can be enabled by setting keepSortState to true. * fields => an array of fields object definitions: * example: [{fieldName : "firstName"}, {fieldName : "lastName"}] * example 2: [{fieldIndex : 1} , {fieldIndex : 2}] * * @param fields an array of fields object definitions * @param direction asc / desc direction */ sort(fields: Object, direction: string): void; /** * This clears local sorting applied to the data view by resetting it to the original data and applying any paging */ clearLocalSorting(): void; /** * Filters the data source locally by text. If "fields" parameter is set search is performed only in the listed fields otherwise all fields are searched. * * @param expression a text to search for. Multiple search texts should be separated by space. When multiple search texts are provided all of them should be presented in the search fields (bool logic "and" is applied). * @param fields an array of fields that will be searched. */ filterByText(expression: string, fields?: any[]): void; /** * Filters the data source locally. Remote filtering can be performed by just calling dataBind() and * setting the settings.filtering.expressions. The result (filtered data) can be obtained by calling dataView() * example: [{fieldName : "firstName", expr: "abc", cond: "StartsWith"}, {fieldName : "lastName"}] * example 2: [{fieldIndex : 1} , {fieldIndex : 2, expr: "a", cond : "contains"}] * example 3: [{filterAllFields: true, expr: "abc", fields: [name: "Description", type: "string"]}] * expr is the filter expression text , such as "abc", or a regular expression such as *test* * cond is the filtering condition such as startsWith, endsWith, contains, equals, doesNotEqual, doesNotContain * if expr is detected to be a regular expression, the "cond" part is skipped * To [filter by text](ig.datasource#methods:filterByText) "fieldExpressions" should have only one object with the following schema: * {filterAllFields: <type="bool" should be set to true>, expr: <type="string" the text to search for>, fields: <type="array" an array of [fields](ig.dataschema#options:schema.fields) to search in>} * * @param fieldExpressions a list of field expression definitions * @param boolLogic boolean logic. Accepted values are AND and OR. * @param keepFilterState if keepFilterState is set to true, it will not discard previous filtering expressions * @param fieldExpressionsOnStrings a list of field expression definitions (or a string with the conditions separated by AND/OR operator, example: "ID = 1 OR ID = 2"), which when applied will threat the related field as if it's string and can only apply conditions valid for string types. */ filter( fieldExpressions: Object, boolLogic: Object, keepFilterState: boolean, fieldExpressionsOnStrings: Object, ): void; /** * This clears local filtering applied to the data view by resetting it to the original data and applying any paging */ clearLocalFilter(): void; /** * Applicable only when the data source is bound to remote data. * Gets / sets the total number of records in the data source. * If data binding is remote, and there's paging or filtering enabled, * the actual total number of records may not * match the number of records that exists on the client * * @param count the total number of records * @param key * @param dsObj * @param context */ totalRecordsCount(count?: number, key?: Object, dsObj?: Object, context?: Object): number; /** * Gets / sets if the response from the server contains a property which specifies the total number of records in the server-side backend * * @param hasCount specifies if the data source contains a property that denotes the total number of records in the server-side backend */ hasTotalRecordsCount(hasCount: boolean): void; /** * Returns metadata object for the specified key * * @param key Primary key of the record */ metadata(key: string): Object; /** * Returns the total number of records in the local data source */ totalLocalRecordsCount(): number; /** * Returns the total number of pages */ pageCount(): number; /** * Gets /sets the current page index. If an index is passed as a parameter, the data source is re-bound. * * @param index the page index. If none is specified, returns the current page index. */ pageIndex(index?: number): number; /** * Gets /sets the page index that should be persisted. For now ONLY when filtering is applied and call explicitly DataBind. * * @param value the page index that should be persisted. If none is specified, returns the current page index that should be persisted. */ persistedPageIndex(value?: number): number; /** * Sets the page index to be equal to the previous page index and rebinds the data source */ prevPage(): void; /** * Sets the page index to be equal to the next page index and rebinds the data source */ nextPage(): void; /** * Gets /sets the page size and rebinds the data source if a parameter is specified. If no parameter is passed, returns the current page size * * @param s the page size. */ pageSize(s?: number): number; /** * For internal use * * @param dirty */ pageSizeDirty(dirty: Object): void; /** * Returns a list of records for the specified page. Implies that paging is enabled. * * @param p the page index for which records will be returned */ recordsForPage(p: number): void; /** * Converts a HTML TABLE dom element to a JavaScript array of objects that contain the records data * * @param tableDOM TABLE dom element to transform */ tableToObject(tableDOM: Element): Object; /** * Parses the string and returns an evaluated JSON object * * @param s the JSON as string. */ stringToJSONObject(s: string): void; /** * Parses a string and returns a XML Document * * @param s the XML represented as a string */ stringToXmlObject(s: string): void; /** * Returns collection of data and non-data(grouped) records. Flat representation of hierarchical data */ groupByData(): any[]; /** * Returns collection of data and non-data(grouped) records. Returns only visible records(children of collapsed grouped records are not included in the collection) */ visibleGroupByData(): any[]; /** * Returns the current normalized/transformed and paged/filtered/sorted group-by data */ groupByDataView(): any[]; /** * Toggle grouped record with the specified id and updates collections visible groupby data and data view * * @param id data-id attribute of the respective group row in the DOM * @param collapsed if true the record should be collapsed, otherwise expanded */ toggleGroupByRecord(id: string, collapsed: boolean): void; /** * Check whether the specified gorupby record is collapsed * * @param gbRec id of the grouped record OR grouped record */ isGroupByRecordCollapsed(gbRec: Object): boolean; /** * Check whether grouping is applied for the specified sorting expressions. * * @param exprs array of sorting expressions. If not set check expressions defined in sorting settings */ isGroupByApplied(exprs?: any[]): boolean; } } interface IgniteUIStatic { DataSource: typeof Infragistics.DataSource; } declare namespace Infragistics { class TypeParser { toStr(obj: Object): void; /** * L.A. 18 June 2012 Fixing bug #113265 Column 'date' shows empty values as 'NaN' * * @param obj */ toDate(obj: Object): void; toTime(obj: Object): void; toNumber(obj: Object): void; toBool(obj: Object): void; isNullOrUndefined(obj: Object): void; empty(): void; num(): void; } } interface DataSchemaSchemaFields { /** * Name of the field */ name?: string | undefined; /** * data type of the fieldstring * number * bool * date * time * object * * Valid values: * "time" */ type?: string | number | boolean | Date | Object | undefined; /** * The XPath expression to map the node to the field */ xpath?: string | undefined; /** * This option is applicable only for fields with fieldDataType="object". Reference to a function (string or function) that can be used for complex data extraction from the data records, whose return value will be used for all data operations associated with this field. */ mapper?: string | Function | undefined; /** * ParamType="function" optional="true" formatter function which accepts three parameters: val - value of the field; record - data source record; field - field definition; and return the formatted string. Formatter function is used when filtering by all fields. */ formatter?: any; /** * Option for DataSchemaSchemaFields */ [optionName: string]: any; } interface DataSchemaSchema { /** * A list of field definitions specifying the schema of the data source. Field objects description: {name, [type], [xpath]} * returnType="array" */ fields?: DataSchemaSchemaFields | undefined; /** * This is the property (path) in the data source where the records are located. */ searchField?: string | undefined; /** * This is the property in the resulting object where actual resulting records will be put. (So the result will not be array but an object if this is defined), after the potential data source transformation */ outputResultsName?: string | undefined; /** * This is the property (xpath) in the data source where the child records of a record are located. Used in XML binding. */ childDataProperty?: string | undefined; /** * Option for DataSchemaSchema */ [optionName: string]: any; } declare namespace Infragistics { class DataSchema { constructor(schema: DataSchemaSchema); /** * Performs a transformation on the schema so that the resulting data matches the schema * * @param data the data to transform */ transform(data: Object): Object; /** * Specifies if the object is null, undefined, or an empty string * * @param o the object to check for being empty */ isEmpty(o: Object): Object; /** * Specifies if the object has custom properties or not * * @param obj the object to check for presence or lack of custom properties */ isObjEmpty(obj: Object): Object; /** * A list of field definitions specifying the schema of the data source. * Field objects description: {fieldName, [fieldDataType], [fieldXPath]} */ fields(): any[]; } } interface IgniteUIStatic { DataSchema: typeof Infragistics.DataSchema; } declare namespace Infragistics { class RemoteDataSource { constructor(settings: DataSourceSettings); /** * Sets a list of fields to the data source. If no parameter is specified, just returns the already existing list of fields * * @param fields a field has the following format: {key: 'fieldKey', dataType: 'string/number/date' } */ fields(fields?: Object): Object; /** * Analyzes the dataSource setting to automatically determine the type of the data source. Returns the data source type. See settings.type */ analyzeDataSource(): string; /** * Returns the current normalized/transformed and paged/filtered/sorted data, i.e. the dataView */ dataView(): any[]; /** * Returns all of the bound data, without taking into account local paging, sorting, filtering, etc. */ data(): Object; /** * Returns transformed data according to transformed execution: * 1. Before paging and filtering * 2. After filtering before paging * 3. After filtering and paging * * @param transformedExecution */ transformedData(transformedExecution: Object): Object; /** * Returns summaries data */ dataSummaries(): Object; /** * Gets/sets the schema definition. * * @param s a schema object * @param t type of the data source. See settings.type */ schema(s?: Object, t?: string): void; /** * Gets/sets a list of paging settings * * @param p object holding all paging settings. See settings.paging */ pagingSettings(p?: Object): Object; /** * Gets/sets a list of filtering settings * * @param f object holding all filtering settings. See settings.filtering */ filterSettings(f?: Object): void; /** * Gets/sets a list of paging settings * * @param s object holding all sorting settings. See settings.sorting */ sortSettings(s?: Object): Object; /** * Gets/sets a list of summaries settings. * * @param s object holding all summaries settings. See settings.summaries */ summariesSettings(s?: Object): void; /** * Gets/sets the dataSource setting. If no parameter is specified, returns settings.dataSource * * @param ds */ dataSource(ds?: Object): Object; /** * Gets/sets the type of the dataSource. If no parameter is specified, returns settings.type * * @param t * @return json|xml|unknown|array|function|htmlTableString|htmlTableId|htmlTableDom|invalid|remoteUrl|empty */ type(t?: Object): string; /** * Returns a record by a specified key (requires that primaryKey is set in the settings) * * @param key Primary key of the record * @param ds the data source in which to search for the record. When not set it will use the current data source. * @param objPath Not used in $.ig.DataSource */ findRecordByKey(key: Object, ds?: string, objPath?: string): Object; /** * Removes a specific record denoted by the primaryKey of the passed key parameter from the data source * * @param key primary key of the record * @param origDs */ removeRecordByKey(key: Object, origDs: Object): void; /** * Removes a record from the data source at specific index. * * @param index index of record * @param origDs */ removeRecordByIndex(index: number, origDs: Object): void; /** * Sets a cell value for the cell denoted by rowId and colId. Creates a transaction for the update operation and returns it * * @param rowId the rowId - row key (string) or index (number) * @param colId the column id - column key (string) or index (number) * @param val The new value * @param autoCommit if autoCommit is true, it updates the datasource automatically and the transaction is still stored in the accumulated transaction log */ setCellValue(rowId: Object, colId: Object, val: Object, autoCommit: boolean): Object; /** * Updates a record in the datasource. Creates a transaction that can be committed / rolled back * * @param rowId the record key - primaryKey (string) or index (number) * @param rowObject the record object containing the key/value pairs we want to update. It doesn't have to include key/value pairs for all fields defined in the schema or in the data source (if no schema is defined) * @param autoCommit if autoCommit is true, the datasource will be updated automatically and the transaction is still stored in the accumulated transaction log */ updateRow(rowId: Object, rowObject: Object, autoCommit: boolean): Object; /** * Adds a new row to the data source. Creates a transaction that can be committed / rolled back * * @param rowId the record key - primaryKey (string) or index (number) * @param rowObject the new record data. * @param autoCommit if autoCommit is true, the datasource will be updated automatically and the transaction is still stored in the accumulated transaction log */ addRow(rowId: Object, rowObject: Object, autoCommit: boolean): Object; /** * Adds a new row to the data source. Creates a transaction that can be committed / rolled back * * @param rowId the record key - primaryKey (string) or index (number) * @param rowObject the new record data. * @param rowIndex row index at which to insert the new row * @param autoCommit if autoCommit is true, the datasource will be updated automatically and the transaction is still stored in the accumulated transaction log * @param parentRowId Not used in $.ig.DataSource */ insertRow(rowId: Object, rowObject: Object, rowIndex: number, autoCommit: boolean, parentRowId: Object): Object; /** * Deletes a row from the data source. * * @param rowId the record key - primaryKey (string) or index (number) * @param autoCommit if autoCommit is true, the datasource will be updated automatically and the transaction is still stored in the accumulated transaction log */ deleteRow(rowId: Object, autoCommit: boolean): Object; /** * Adds a new node to the tree data source. Creates a transaction that can be committed / rolled back * * @param data the transaction data */ addNode(data: Object): void; /** * Removes a node from the tree data source. Creates a transaction that can be committed / rolled back * * @param data the transaction data */ removeNode(data: Object): void; /** * Returns a standalone object (copy) that represents the commited transactions, but detached from the data source * * @param t a transaction object */ getDetachedRecord(t: Object): Object; /** * Update the data source with every transaction from the log * * @param id Id of the transaction to commit. If no id is specified, will commit all transactions to the data source. */ commit(id?: number): void; /** * Clears the transaction log without updating anything in the data source * * @param id Record Id to find transactions for. If no id is specified, will rollback all transactions to the data source. */ rollback(id?: Object): void; /** * Returns a list of all transaction objects that are pending to be committed or rolled back to the data source */ pendingTransactions(): any[]; /** * Returns a list of all transaction objects that are either pending, or have been committed in the data source. */ allTransactions(): any[]; /** * Returns the accumulated transaction log as a string. The purpose of this is to be pas