Sha256: d34cc353aebb4f1e2a783fcfd81ab56e984a8f8d202b416b20e4d9d15689982e
Contents?: true
Size: 793 Bytes
Versions: 13
Compression:
Stored size: 793 Bytes
Contents
// belongs_to form $(function() { $(".field-unit--belongs-to-search select").each(function initializeSelectize(index, element) { var $element = $(element); $element.selectize({ valueField: 'id', labelField: 'dashboard_display_name', searchField: 'dashboard_display_name', create: false, searchUrl: $element.data('url') + '?search=', load: function(query, callback) { if (!query.length) return callback(); var searchUrl = this.settings.searchUrl; $.ajax({ url: searchUrl + encodeURIComponent(query), type: 'GET', error: function() { callback(); }, success: function(res) { callback(res.resources); } }); }, }); }); });
Version data entries
13 entries across 13 versions & 2 rubygems