query-function.html 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <section>
  2. <h2 id="query">
  3. Querying old data with <code>query</code>
  4. </h2>
  5. <p class="alert alert-warning">
  6. <a href="announcements-4.0.html#query-to-data-adapter" class="alert-link">Deprecated in Select2 4.0.</a>
  7. This has been replaced by another option and is only available in the
  8. <a href="index.html#builds-full" class="alert-link">full builds</a> of
  9. Select2.
  10. </p>
  11. <p>
  12. In the past, Select2 supported an option called <code>query</code> that
  13. allowed for a custom data source to be used. This option has been replaced
  14. by the <code>query</code> method on the
  15. <a href="#dataAdapter">data adapter</a> and takes a very similar set of
  16. parameters.
  17. </p>
  18. <div class="row">
  19. <div class="col-sm-6">
  20. <dl class="dl-horizontal">
  21. <dt>Key</dt>
  22. <dd>
  23. <code>query</code>
  24. </dd>
  25. <dt>Value</dt>
  26. <dd>
  27. A function taking <code>params</code> (including a <code>callback</code>)
  28. </dd>
  29. </dl>
  30. </div>
  31. <div class="col-sm-6">
  32. <dl class="dl-horizontal">
  33. <dt>Adapter</dt>
  34. <dd>
  35. <code title="select2/data/base">DataAdapter</code>
  36. </dd>
  37. <dt>Decorator</dt>
  38. <dd>
  39. <code title="select2/compat/query">Query</code>
  40. </dd>
  41. </dl>
  42. </div>
  43. </div>
  44. </section>