1.5.6 • Published 7 years ago

rekord-jquery v1.5.6

Weekly downloads
6
License
MIT
Repository
github
Last release
7 years ago

rekord-jquery

Build Status devDependency Status Dependency Status License Alpha

A rekord binding to jquery - implementing Rekord.rest.

The easiest way to install is by using bower via bower install rekord-jquery.

You can add global options to send to $.ajax by modifying Rekord.jQuery.options or by overriding the Rekord.jQuery.adjustOptions function which is given (options, database, method, model, data, url, success, failure) and should be used to dynamically modify the options.

// Add global options
Rekord.jQuery.options.username = 'John';
Rekord.jQuery.options.password = 'password#1';

// Add/override options dynamically
Rekord.jQuery.adjustOptions = function(options, database, method, model, data, url, success, failure) {
  if (database.name === 'todos' && model) {
    options.url = database.api + model.list_id + '/todos/' + model.$$key();
  }
};

// Override how options are processed
Rekord.jQuery.ajax = function(options) {
  $.ajax( options ); // default
};

// The class instantiated with a database instance that implements Rekord.rest
Rekord.jQuery.RestClass;

// The function which returns a Rekord.rest implementation given a database
// Normally Rekord.rest is the same value but multiple back-ends could be used
Rekord.jQuery.rest;
1.5.6

7 years ago

1.5.0

7 years ago

1.4.3

8 years ago

1.4.2

8 years ago

1.4.1

8 years ago