IDBRequest

@native @JSGlobal @JSType
class IDBRequest[+S, A] extends EventTarget

The IDBRequest interface of the IndexedDB API provides access to results of asynchronous requests to databases and database objects using event handler attributes. Each reading and writing operation on a database is done using a request.

The request object does not initially contain any information about the result of the operation, but once information becomes available, an event is fired on the request, and the information becomes available through the properties of the IDBRequest instance.

Type parameters:
A

Type of .target.result on events

S

Type of .source on events

class Object
trait Any
class Object
trait Matchable
class Any

Value members

Concrete methods

Returns a DOMException in the event of an unsuccessful request, indicating what went wrong.

Returns a DOMException in the event of an unsuccessful request, indicating what went wrong.

The state of the request. Every request starts in the pending state. The state changes to done when the request completes successfully or when an error occurs.

The state of the request. Every request starts in the pending state. The state changes to done when the request completes successfully or when an error occurs.

def result: A

Returns the result of the request. If the the request failed and the result is not available, the InvalidStateError exception is thrown.

Returns the result of the request. If the the request failed and the result is not available, the InvalidStateError exception is thrown.

def source: S

The source of the request, such as an Index or a ObjectStore. If no source exists (such as when calling IDBFactory.open), it returns null.

The source of the request, such as an Index or a ObjectStore. If no source exists (such as when calling IDBFactory.open), it returns null.

The transaction for the request. This property can be null for certain requests, such as for request returned from IDBFactory.open (You're just connecting to a database, so there is no transaction to return).

The transaction for the request. This property can be null for certain requests, such as for request returned from IDBFactory.open (You're just connecting to a database, so there is no transaction to return).

Inherited methods

def addEventListener[T <: Event](`type`: String, listener: Function1[T, _], options: EventListenerOptions): Unit

The EventTarget.addEventListener() method registers the specified listener on the EventTarget it's called on. The event target may be an Element in a document, the Document itself, a Window, or any other object that supports events (such as XMLHttpRequest).

The EventTarget.addEventListener() method registers the specified listener on the EventTarget it's called on. The event target may be an Element in a document, the Document itself, a Window, or any other object that supports events (such as XMLHttpRequest).

This implementation accepts a settings object of type EventListenerOptions.

Inherited from:
EventTarget
def addEventListener[T <: Event](`type`: String, listener: Function1[T, _], useCapture: Boolean): Unit

The EventTarget.addEventListener() method registers the specified listener on the EventTarget it's called on. The event target may be an Element in a document, the Document itself, a Window, or any other object that supports events (such as XMLHttpRequest).

The EventTarget.addEventListener() method registers the specified listener on the EventTarget it's called on. The event target may be an Element in a document, the Document itself, a Window, or any other object that supports events (such as XMLHttpRequest).

Inherited from:
EventTarget
def dispatchEvent(evt: Event): Boolean

Dispatches an Event at the specified EventTarget, invoking the affected EventListeners in the appropriate order. The normal event processing rules (including the capturing and optional bubbling phase) apply to events dispatched manually with dispatchEvent().

Dispatches an Event at the specified EventTarget, invoking the affected EventListeners in the appropriate order. The normal event processing rules (including the capturing and optional bubbling phase) apply to events dispatched manually with dispatchEvent().

Inherited from:
EventTarget
def hasOwnProperty(v: String): Boolean
Inherited from:
Object
def isPrototypeOf(v: Object): Boolean
Inherited from:
Object
def propertyIsEnumerable(v: String): Boolean
Inherited from:
Object
def removeEventListener[T <: Event](`type`: String, listener: Function1[T, _], options: EventListenerOptions): Unit

Removes the event listener previously registered with EventTarget.addEventListener.

Removes the event listener previously registered with EventTarget.addEventListener.

This implementation accepts a settings object of type EventListenerOptions.

Inherited from:
EventTarget
def removeEventListener[T <: Event](`type`: String, listener: Function1[T, _], useCapture: Boolean): Unit

Removes the event listener previously registered with EventTarget.addEventListener.

Removes the event listener previously registered with EventTarget.addEventListener.

Inherited from:
EventTarget
def toLocaleString(): String
Inherited from:
Object
def valueOf(): Any
Inherited from:
Object

Concrete fields

var onerror: Function1[ErrorEvent, _]

The event handler for the error event.

The event handler for the error event.

var onsuccess: Function1[IDBEvent[A], _]

The event handler for the success event.

The event handler for the success event.