purtuga / SPWidgets

Sharepoint Custom UI Widgets
74 stars 34 forks source link

resolvePrincipals function is coming as undefined. #46

Closed ymihir closed 9 years ago

ymihir commented 9 years ago

I am trying to resolve the users in filters suggestions due to i am getting users with account id -1. So for this i am using code like this. $().pickSPUser.resolvePrincipals({ principalKey:elem.accountName }).done(function(xmlDoc, textstatus, jqXHR){ var $doc = $(xmlDoc); return ($doc); });
But it is giving me an error. If I try to execute the same function in console, it is giving me the error as image What could be possible resolution for this. I am using version SPWidgets v2.5.0 2015-01-10

purtuga commented 9 years ago

Thats because that function, as you defined it above, does not exsts... What made you try the code block above? Did you see it somewhere in the documentation here?


The pickSPUser widget already does a resolvePrincipals as long as the resolvePrincipals input option to pickSPUser is set to true (which is the default). If you still want to do a resolvePrincipals yourself, then you can access this API method via $.SPWidgets.SPAPI.resolvePrincipals... Note that as of today, these API methods are un-documented in SPWidgets...

Note: there were some changes after v2.5.1 to the people picker... I would suggest you pickup the latest from the dist folder here on github.

purtuga commented 9 years ago

I'm closing this... Feel free to open it back up if still an issue.