initial-selection.html 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <section>
  2. <h2 id="initSelection">
  3. Old initial selections with <code>initSelection</code>
  4. </h2>
  5. <p class="alert alert-warning">
  6. <a href="announcements-4.0.html#removed-initselection" 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 required an option called <code>initSelection</code>
  13. that was defined whenever a custom data source was being used, allowing
  14. for the initial selection for the component to be determined. This has
  15. been replaced by the <code>current</code> method on the
  16. <a href="#dataAdapter">data adapter</a>.
  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>initSelection</code>
  24. </dd>
  25. <dt>Value</dt>
  26. <dd>
  27. A function taking 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/initSelection">InitSelection</code>
  40. </dd>
  41. </dl>
  42. </div>
  43. </div>
  44. </section>