javascript - jquery select2 append selected item? -
i'm trying select item multi select jquery select2 ajax
html
<select name="schools" id="schools" multiple='multiple'> <option value="-1000">select all</option> <option value="35102907">org1</option> </select> js
$("#schools").select2({ ajax: { url: "ajax_controller.php", datatype: 'json', data: function (params) { return { a: 'getschoollist', c: 'model_milk_contract', p: [params.term], cs: csrf } }, processresults: function (response) { return { results: $.map(response, function(obj) { return { id: obj.org_code, text: obj.org_name }; }) } } } });
but when 1 item selected, jquery says in console:
uncaught typeerror: failed execute 'appendchild' on 'node': parameter 1 not of type 'node'.
then tried find problem , after time found in below line of jquery core, ret[i] must node object, gets array of node objects , if pass ret[i][0] function, works!
fragment.appendchild( ret[i] ); what's problem?!
finaly found problem: jquery old , version 1.7.1 while select2 version 4 needs min jquery 1.8. thanks...
Javascript - Jquery Select2 Append Selected Item? - >>>>> Download Now
ReplyDelete>>>>> Download Full
Javascript - Jquery Select2 Append Selected Item? - >>>>> Download LINK
>>>>> Download Now
Javascript - Jquery Select2 Append Selected Item? - >>>>> Download Full
>>>>> Download LINK Dg