Sha256: 8d2b3995cd97d26bbca074a6fe5faf09dfb6b4911843e89ca559d61439ae9437
Contents?: true
Size: 1.06 KB
Versions: 121
Compression:
Stored size: 1.06 KB
Contents
// Generic select2 ajax search for patients. // Example usage // select#patient-ajax-search("data-ajax--url" => search_patients_path(format: :json)) // var Renalware = typeof Renalware === 'undefined' ? {} : Renalware; Renalware.PatientSearch = (function() { var initPatientSearch = function(){ var dropDown = $(".patient-ajax-search"); $(dropDown).select2({ language: { inputTooShort: function(args) { return $(dropDown).data("hint"); } }, ajax: { dataType: 'json', delay: 250, data: function (params) { return { term: params.term }; }, processResults: function (data, params) { return { results: data }; }, cache: true }, minimumInputLength: 3 }); }; return { init: function () { initPatientSearch() } }; }()); $(document).ready(Renalware.PatientSearch.init); $(document).on('opened.fndtn.reveal', '[data-reveal]', function() { Renalware.PatientSearch.init(); });
Version data entries
121 entries across 121 versions & 1 rubygems