More reliable way to get usersID

This commit is contained in:
Pierre 2017-06-07 16:38:06 +02:00
parent 7d66064187
commit dd900eb59d

View File

@ -82,15 +82,18 @@ ComunicWeb.components.userSelect = {
*/ */
getResults: function(inputSelect){ getResults: function(inputSelect){
//Get entries
var selectUsersResult = $(inputSelect).select2("data");
//Prepare return //Prepare return
var usersID = []; var usersID = [];
for(i in inputSelect.children){ for(i in selectUsersResult){
//Check it is really a children //Check it is really a children
if(inputSelect.children[i].value){ if(selectUsersResult[i].id){
//Add ID to the table //Add ID to the table
usersID.push(inputSelect.children[i].value); usersID.push(selectUsersResult[i].id);
} }
} }