javascript - Selectize load function is not triggered on typing -
i have following selectize element:
$('#my_selectize').selectize({ valuefield: 'value', labelfield: 'text', options: [{'value':1,'text':'abc','inn':123}], render: { option: function(data, escape) { //return .... }, load: function(query, callback) { if (!query.length) // breakpoint not triggered return callback(); $.ajax({ url: '{% url my_url %}', type: 'get', data: {q: query}, error: function() { callback(); }, success: function(res) { callback(json.parse(vendor_options_json.f)); } }); } }});
according docs, once user starts typing, should see browser stop @ breakpoint put on commented line if-condition (if (!query.length)). doesn't happen. there misunderstood it? far understand, load-method responsible fetching server-side options match user typing.
Comments
Post a Comment