Sha256: 099470b4cf102e7e6ddd0b5b864a7cd6c323c51fb7392665a8524d6958d5260b
Contents?: true
Size: 1.02 KB
Versions: 5
Compression:
Stored size: 1.02 KB
Contents
$(document).ready(function() { if ($("#product_option_type_ids").length > 0) { $("#product_option_type_ids").select2({ placeholder: "Add an option type", multiple: true, initSelection: function(element, callback) { return $.getJSON(Spree.routes.option_type_search + "?ids=" + (element.val()), null, function(data) { return callback(data); }) }, ajax: { url: Spree.routes.option_type_search, quietMillis: 200, datatype: 'json', data: function(term, page) { return { q: { name_cont: term } } }, results: function (data, page) { console.log(data) return { results: data } } }, formatResult: function(option_type) { return option_type.presentation + " (" + option_type.name + ")" }, formatSelection: function(option_type) { return option_type.presentation + " (" + option_type.name + ")" } }) } })
Version data entries
5 entries across 5 versions & 1 rubygems