load – Download software via Ajax Select2

$ .ajax ({
url: "@ Url.Action (" Grupo ")",
type: "POST",
data: JSON.stringify (template),
contentType: "application / json; charset = utf-8",
dataType: "json",
success: function (answer) {
console.log (& # 39; oi1: & # 39;);

var strChk = "";
$ (& # 39 ;. grupo & # 39;). empty ();
// $ (& # 39 ;. grupo & # 39;). Append ("");
$ .each (response.listGrupo, function (key, index) {

console.log (& # 39; oi 2: & # 39;);
// $ (& # 39 ;. grupo & # 39;). append ("");
$ (& # 39; .grupo & # 39;). select2 (& # 39; destroy & # 39;). html ("") .prop (" disabled ", false) .select2 ();
})

}
error: function (answer) {

alertify.error ("Erro ao carregar as campanhas");
}
}). done (function () {

});