jquery - Get select2 4.0.0 ajax response data -


i have more fields associated select2 beside id , text , can't them way did in version 3.5.2 (i'm using version 4.0.0 now):

var id = $('#something').select2('data').id; var name= $('#something').select2('data').text; var email= $('#something').select2('data').email; 

i found id , text:

var id = $('#something').val(); var name = $('#something').text(); 

but must other fields associated , i'm not finding way. note: select2 filled via ajax request database table , checked json data correctly returned data.


Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -