| Recommend this page to a friend! | 
| Classes of fathurrahman | mnTemplate | public/asset/vendor/select2/docs/pages/06.data-sources/03.arrays/docs.md | Download | 
| 
 | |||||||||||||||||||||
|  Download title: Arrays taxonomy: process: never_cache_twig: trueLoading array dataYou may use the  You can provide initial selections with array data by providing the option tag for the selected values, similar to how it would be done for a standard select. <div class="s2-example"> <p> </p> <p> </p> </div> <pre data-fill-from=".js-code-placeholder"></pre> <script type="text/javascript" class="js-code-placeholder"> var data = [ ]; $(".js-example-data-array").select2({ data: data }) $(".js-example-data-array-selected").select2({ data: data }) </script> Unlike the case of items supplied by AJAX data sources, items supplied as an array will be immediately rendered as  Backwards compatibility with the  |