Skip to content

Commit

Permalink
Merge pull request #8 from doyle-johnpaul/SMP941_Compatibility_Release
Browse files Browse the repository at this point in the history
Returned properties changed
  • Loading branch information
doyle-johnpaul authored Dec 20, 2019
2 parents 923ddfe + 5862777 commit 1c4a543
Showing 1 changed file with 67 additions and 13 deletions.
80 changes: 67 additions & 13 deletions custom_ROToolbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -959,7 +959,9 @@ function createAutoComplete(tag, tagElement) {
});
return {
"DisplayName": append,
"BaseId": user.BaseId
"BaseId": user.BaseId,
"Id": user.Id,
"ClassTypeId": user.ClassTypeId
};
});
return json;
Expand Down Expand Up @@ -1040,12 +1042,37 @@ function createAutoComplete(tag, tagElement) {
data: "Data"
}
}),
select: function(e) {
var item = this.dataItem(e.item.index());
$("input[id='" + targetId + "']").each(function(i, el) {
$(el).val(item.BaseId);
$(el).change();
});
change: function(e) {
var newData = [];
if (multiselect === 'True') {
this.dataItems().forEach(function (val, index, arr) {
if (_.isUndefined(val.BaseId)) {
val.BaseId = !_.isUndefined(val.Id) ? val.Id : null;
}
newData.push(val);
});

} else {
var dataItem = this.dataItem();

if (_.isUndefined(dataItem.BaseId)) {
dataItem.BaseId = !_.isUndefined(dataItem.Id) ? dataItem.Id : null;
}

newData.pop();
newData.push(dataItem);
}

var selectedItems = newData;
var selectedItemIds = _.pluck(selectedItems, "BaseId");
$("input[id='" + targetId + "']").each(function (i, el) {
$(el).val(selectedItemIds.join(','));
$(el).change();
});

var newDataJSON = [];
newDataJSON = selectedItems;
$('#Json' + targetId).val(JSON.stringify(newDataJSON));
//Process DataMerge functions to get data related to selected items and add to list to be added to other multiselect/autocomplete controls
$("#ac" + targetId).each(function() {
ROTBGetDataName = $(this).attr('ROToolBoxGetDataName');
Expand Down Expand Up @@ -1307,7 +1334,9 @@ function createMultiSelect(tag, tagElement) {
});
return {
"DisplayName": append,
"BaseId": user.BaseId
"BaseId": user.BaseId,
"Id": user.Id,
"ClassTypeId": user.ClassTypeId
};
});
return json;
Expand Down Expand Up @@ -1393,11 +1422,36 @@ function createMultiSelect(tag, tagElement) {
}
}),
change: function(e) {
var selectedItems = this.value().join(",");
$("input[id='" + targetId + "']").each(function(i, el) {
$(el).val(selectedItems);
$(el).change();
});
var newData = [];
if (multiselect === 'True') {
this.dataItems().forEach(function (val, index, arr) {
if (_.isUndefined(val.BaseId)) {
val.BaseId = !_.isUndefined(val.Id) ? val.Id : null;
}
newData.push(val);
});

} else {
var dataItem = this.dataItem();

if (_.isUndefined(dataItem.BaseId)) {
dataItem.BaseId = !_.isUndefined(dataItem.Id) ? dataItem.Id : null;
}

newData.pop();
newData.push(dataItem);
}

var selectedItems = newData;
var selectedItemIds = _.pluck(selectedItems, "BaseId");
$("input[id='" + targetId + "']").each(function (i, el) {
$(el).val(selectedItemIds.join(','));
$(el).change();
});

var newDataJSON = [];
newDataJSON = selectedItems;
$('#Json' + targetId).val(JSON.stringify(newDataJSON));
//Process DataMerge functions to get data related to selected items and add to list to be added to other multiselect/autocomplete controls
$("#ms" + targetId).each(function() {
ROTBGetDataName = $(this).attr('ROToolBoxGetDataName');
Expand Down

0 comments on commit 1c4a543

Please sign in to comment.