AnsweredAssumed Answered

Converting my Nintex Classic Form to Responsive, unfortunately the PeoplePickerAPI does not work anymore.

Question asked by javamhan on Jul 3, 2018
Latest reply on Jul 9, 2018 by emha

Hi,

 

Below are the codes I'm using based on the topic I found.

 

/* Add PeoplePickerApi to NF */
/*
(function() {
NF.PeoplePickerApi = (function ($) {
var getData = function (ins) {
ins.d = ins.d || ins.$elem.data("uiItempicker");
return ins.d;
};
var ctor = function (elem) {
this.$elem = $(elem);
};
ctor.prototype = {
added: function (func) {
var a = getData(this).options.itemAdded;
getData(this).options.itemAdded = function () {
a();
func();
};
},
removed: function (func) {
var r = getData(this).options.itemRemoved;
getData(this).options.itemRemoved = function () {
r();
func();
};
},
search: function (term) {
var config = this.$elem.data();
return $.getJSON(config.url + "/_vti_bin/NintexFormsServices/NfRestService.svc/AutocompleteValue/PeoplePicker",
{ term: term, types: config.selectionset, group: config.sharepointgroup, });
},
add: function (value) {
getData(this)._addItem(value);
},
remove: function (valueOrPredicate) {
var self = this; var func = $.isFunction(valueOrPredicate) ? valueOrPredicate : function () {
return this == valueOrPredicate;
};
var items = this.$elem.parent().find('.ip-item').filter(function (index) {
return func.call($(this).data('val'));
});
items.each(function () {
getData(self)._removeItem($(this));
});
},
clear: function () {
var self = this; self.$elem.parent().find('.ip-item').each(function () {
getData(self)._removeItem($(this))
});
}
};
return ctor;
})(NWF$);
})();

 

The _addItem, _removeItem and other methods are not recognize.  Any workaround?

 

Thanks!

 

Norbz

Outcomes