This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Select2 | |
* | |
* Renders Select2 - jQuery based replacement for select boxes | |
* | |
* Simply pass a 'config' object on your schema, with any options to pass into Select2. | |
* See http://ivaynberg.github.com/select2/#documentation | |
*/ | |
Backbone.Form.editors.Select2 = Backbone.Form.editors.Base.extend({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Creates an ajax-chosen instance | |
* @see https://github.com/powmedia/ajax-chosen | |
* | |
* @param {String} options.schema.queryUrl URL for ajax queries | |
* @param {Function} options.schema.itemToString Function that takes an item and returns how it should be displayed | |
*/ | |
module.exports = Backbone.Form.editors.Select.extend({ | |
render: function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Customise Backbone.sync to work with Titanium rather than jQuery | |
Backbone.sync = (function() { | |
var methodMap = { | |
'create': 'POST', | |
'read' : 'GET', | |
'update': 'PUT', | |
'delete': 'DELETE' | |
}; | |
var xhr = Ti.Network.createHTTPClient({ timeout: 5000 }); |