/** * @class Ext.data.virtual.Page * @extend Ext.Base * * This class manages a page of records in a virtual store's `PageMap`. It is created * with the page `number` (0-based) and uses the store's `pageSize` to calculate the * record span covered by it and stores these as `begin` and `end` properties. These * aspects of the `Page` as well as the owning `PageMap` are expected to be immutable * throughout the instance's life-cycle. * * The normal use for a `Page` is by a `Range`. Ranges acquire and `lock` the pages they * span. As they move on, they `release` these locks. The act of locking pages schedules * them for loading. Unlocking pages allows them to be evicted from the `PageMap` to * reclaim memory for other pages. * * @private * @since 6.5.0 */ /** * @property {Number} begin=0 * The start index of the records that this page represents. * Inclusive. * @readonly */ /** * @property {Number} end=0 * The end index of the records that this page represents. * Exclusive. * @readonly */ /** * @property {Error} error * The error instance if the page load `operation` failed. If this property is set, * the `state` will be "error". * @readonly */ /** * @property {"active"/"prefetch"} locked * This property is managed by the `lock` and `release` methods. It is set to `null` * if the page is not locked or it will be set to the string describing the type of * the current lock. * * When pages are `locked` for the first time, they are scheduled for loading by the * owning `pageMap`. * * Locked pages are not eligible for removal from the `PageMap`. * @readonly */ /** * @cfg {Number} [number=0] * The 0-based page number of this page. * @readonly */ /** * @property {Ext.data.operation.Read} operation * The pending read of the records for this page. This property is only set when the * page is in the "loading" `state`. * @readonly */ /** * @property {Ext.data.virtual.PageMap} pageMap * The owning `PageMap` instance. * @readonly */ /** * @property {Ext.data.Model[]} records * The array of records loaded for this page. The `records[0]` item corresponds to * the record at index `begin` in the overall result set. * @readonly */ /** * @property {"loading"/"loaded"/"error"} state * This property describes the current life-cycle state for this page. At creation, * this property will be `null` for the "initial" state. * @readonly */ /** * @method adjustLock * Acquires or releases the specified type of lock to this page. If this causes the * `locked` property to transition to a new value, the `pageMap` is informed to * enqueue or dequeue this page from the loading queues. * @param {"active"/"prefetch"} kind The type of lock. * @param {Number} delta A value of `1` to lock or `-1` to release. */