angularjs - categorised dropdown select2 -
i using select2 multi select dropdown, , works problem is, want categorise drop down list of same. here code
<script src="/static/select2.js"></script> <input type="hidden" id="test" value=""/>
and js
$(test).select2({ data:data, multiple: true, width: "100%", placeholder:"none selected", closeonselect:false, });
this should work:
$(test).select2({ data: [ { text: 'greetings', children: [ { 'id': 1, text: 'hai' }, { 'id': 2, text: 'hellow'}, ] }, { text: 'questions', children: [ { 'id': 3, 'text': 'yes' }, { 'id': 4, 'text': 'no' } ] } ], multiple: true, width: "100%", placeholder: "none selected", closeonselect: false, });
Comments
Post a Comment