0

First of all, this is my first time ever asking anything here so please be gentle.

I am developing this custom html.page(SharePoint Hosted App) for editing purposes of specific SharePoint lists. I have a client side people picker on the page (http://msdn.microsoft.com/en-us/library/office/jj713593%28v=office.15%29.aspx) and everything is working fine until the following:

After getting the wanted User from the people picker and selecting it, i get the following Error:

"0x800a1391 - JavaScript runtime error: 'RemoveCssClassFromElement' is undefined".

The error happens in the _layouts/15/clientpeoplepicker.js reference file, but i have no idea where it tries to to get that RemoveCssClassFromElement() function.

Everything works perfectly if i run the code in default.aspx, but when in custom.html it doesn't

Any ideas?

Scripts i am using in my Custom.html (in order):

<script type="text/javascript" src="../../Scripts/lib/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/4.0/1/MicrosoftAjax.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<script type="text/javascript" src="/_layouts/15/init.js"></script>
<script type="text/javascript" src="/_layouts/15/SP.init.js"></script>
<script type="text/javascript" src="/_layouts/15/sp.runtime.js"></script>
<script type="text/javascript" src="/_layouts/15/sp.js"></script>
<script type="text/javascript" src="/_layouts/15/sp.core.js"></script>


<script type="text/javascript" src="../../Scripts/lib/angular.min.js"></script>
<script type="text/javascript" src="../../Scripts/lib/angular-route.min.js"></script>

<script type="text/javascript" src="../../Scripts/src/services.js"></script>
<script type="text/javascript" src="../../Scripts/src/controllers.js"></script>
<script type="text/javascript" src="../../Scripts/src/App.js"></script>
<script type="text/javascript" src="../../Scripts/init.js"></script>

<script type="text/javascript" src="/_layouts/15/1033/strings.js"></script>">
<script type="text/javascript" src="/_layouts/15/clienttemplates.js"></script>
<script type="text/javascript" src="/_layouts/15/clientforms.js"></script>
<script type="text/javascript" src="/_layouts/15/clientpeoplepicker.js"></script>
<script type="text/javascript" src="/_layouts/15/autofill.js"></script>
<script type="text/javascript" src="../../Scripts/PeoplePicker.js"></script>

UPDATE! picker control:

<div id="peoplePickerDiv"></div>
<div>
    <br/>
    <input type="button" value="Get User Info" onclick="getUserInfo()"></input>
    <br/>
    <h1>User info:</h1>
    <p id="resolvedUsers"></p>
    <h1>User keys:</h1>
    <p id="userKeys"></p> 
    <h1>User ID:</h1>
    <p id="userId"></p>
</div>    

Custom.js is as it is on the MSDN link!

  • Can you please update the question with Custom.html file content (atleast the markup of the picker control) – Amal Hashim Dec 31 '14 at 13:55
  • Added the picker control – Koraxo Dec 31 '14 at 14:53
  • Please specify where the page is hosted. Are you building a SharePoint App? If that's the case, is it SharePoint-hosted or provider-hosted? – Rodrigo Molinas Dec 31 '14 at 15:00
  • Yea sry forgot a lot of info it seems. It is part of a SharePoint Hosted App! – Koraxo Dec 31 '14 at 15:04
0

The function "RemoveCssClassFromElement" is defined in core.js file. Just add reference to it in html markup.

<script type="text/javascript" src="/_layouts/15/core.js"></script>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.