Tag Info

New answers tagged

-1

Try generating relative URL for you js in your masterpage. <SharePoint:ScriptLink Language="JavaScript" Name="~Site/SiteAssets/File.js" runat="server" OnDemand="false"></SharePoint:ScriptLink> Or <script type="text/javascript" src='<asp:Literal runat="server" Text="<%$SPUrl:~Site/%>" />SiteAssets/File.js'></script> ...


1

With a little help from the guys over at stackoverflow I got this figured out. Putting a handler on the <a> tag that stops event propagation. What I added: groupby.find("a").click(function(e) { e.stopPropagation(); }); What it all looks like: $(document).ready(function() { var groupby = $(".ms-gb"); groupby.click(function(){ ...


-2

Well, Publishing feature has got nothing to do with JQuery file. The possible reason for this behavior could be - Publishing feature will usually have additional/different tags in masterpage which could interfere with rendering of the page making it faster, I believe this is the case for you. This is the Lazy loading mechanism in which not all SharePoint ...


0

Use ScriptLink <SharePoint:ScriptLink language="javascript" name="~sitecollection/customer/_catalogs/masterpage/script/jquery-1.11.1.min.js" runat="server" Localizable="false" /> Below is how I recently implemented branding <!--SPM:<SharePoint:CssRegistration ID="CssRegistration1" name="&#60;% ...


1

Based on the answer of Aboba I tweaked the script a little bit. Now you don't have to edit the URL portion everytime you add this script to a displayform. <script src="//code.jquery.com/jquery-1.11.0.min.js"></script> <script> $(document).ready(function(){ var pageID = GetUrlKeyValue("ID", false); pageID++; //Get the current ...


0

Putting the jQuery script tag in the master page should work. Try a complete hard coded URL of the script file to be sure there is not a problem with the relative address parsing. So something like src="http://........./Style Library/NewsTicker/Scripts/jquery.js" (replace the "........." with the appropriate site collection and site path) Then don't ...


1

Try giving class with css margin-left: 25px; (or more) when the menu is hidden. But when the button is clicked (to show the menu) remove this class from the #s4-leftpanel


0

Either on of these lines was all I needed at the beginning of the script..... ExecuteOrDelayUntilScriptLoaded(HideWP, "sp.js"); or _spBodyOnLoadFunctionNames.push("FunctionName");


1

You are loading two different jquery files with different file names (means both will be loaded by the browser). The one jquery will override the other on runtime. I think while the first jQuery is waiting for the DOM to be ready, it will be overwritten by the second jQuery. => so the $(document).ready of one of the webparts will never be called because ...


-2

use this enough $.ShowProcessing("Refreshing Collections...");


0

The SPServices library is only allowing you to do what is available through the web services. A workaround, but not really recommended, would be to create a custom permission level that granted the ability to manage permissions and add users into this group. That would allow them to then execute your code.


3

You cannot do impersonation or permission elevation in client side object model. http://sympmarc.com/2011/05/27/elevating-permissions-with-sharepoints-web-services/ http://spservices.codeplex.com/discussions/392133


0

If I understand the question correctly, SPServices or any other client-side development is not the way to go. Better use out-of-the-box settings of the group to allow any users to view membership and auto-accept requests for joining and leaving the group if that's appropriate for the group. Then simply provide a hyperlink to the group's page ...


2

You could use AddUserToGroup operation for that purpose, for example: $().SPServices({ operation: "AddUserToGroup", groupName: groupName, userLoginName: userLoginName, completefunc: function(data,status){ //... } }); References Managing SharePoint Site User Memberships in Multiple Groups Using SPServices


1

There should be an object on the page named SPClientPeoplePicker.SPClientPeoplePickerDict. It holds information about all your people pickers on page. The ID of your pickers is the property name in the object. So to check type, you could use the following: SPClientPeoplePicker.SPClientPeoplePickerDict["IDofYourPicker"].GetAllUserInfo()[0].EntityType That ...


0

You are loading 2 instances of jQuery and that is what is breaking. I would either include the jQuery reference on your master page or in your page layout. Then your javascript for your web parts don't need to load it.


2

The specified code looks Okay for me. I would suggest to modify updateFile function to include logging (not into browser console), it will allow to simplify the troubleshooting of any errors occurred during updating File properties. How to log errors into ULS from the client-side SharePoint JavaScript Library supports logging errors into ULS. The ...


0

Use jQuery(selector).attr("disabled","disabled") and jQuery(selector).removeAttr("disabled"), then it will work in IE as well.


4

For the situation you're describing, I like using Knockout and the REST API or the SharePoint JavaScript Object Model. Here is a basic example that takes 10 users from the user information list (which is just a hidden list on all 2010 sites) using the REST API, and displays them in an HTML table -- below is the entire source for a content editor to do so (I ...


0

The best way to accomplish this would not to use jQuery. You should be able to do this by doing either of these: Use a list web part of your list with a custom view and use the styles that come with SP. or Create a data view of your list. You can modify that to look exactly how you want it pretty easily.


1

Look at line 5 in his code, he's removing the property for line wraps, rather, removing the stopping of the line breaks, thus allowing line breaks: $("nobr").css("white-space","normal"); // Lets labels wrap Remove that and that should help.


0

It's not clear exactly what you want to do, but OData $filter has a startswith that you should be able to use here. $filter=startswith(City_Name_EN,'M') See this page: http://msdn.microsoft.com/en-us/library/ff798339.aspx and do a find for "startswith". When in doubt, check the OData spec. SharePoint implements it for the most part, though there are ...


0

Where is the page for the iFrame hosted? If you're in an app or in another domain, it won't work, check out http://www.esqsoft.com/javascript_examples/iframe_talks_to_parent/ for more details.


1

You can try the below code for file upload: using (SPWeb web = SPContext.Current.Site.OpenWeb()) { SPList docLibrary = web.Lists["Documents"]; web.AllowUnsafeUpdates = true; Stream fStream = FileUpload1.PostedFile.InputStream; ...


1

This is working on my dev environment from a long time. I guess issue is with single and double inverted commas. Check this <script type="text/javascript" src='<SharePoint:EncodedLiteral runat="server" Text="<%$SPUrl:~sitecollection/Style%20Library/Scripts/jquery-1.11.1.min.js%>" />'></script> <script type="text/javascript" ...


0

Why you should not try like this: <script type="text/javascript" src="server-name/style library/scripts/xyz.js></scripts>


1

There are a number of ways to handle this, but here is one: Create a solution package that deploys the files directly to _layouts. Put each version in a separate folder, for example _layouts/jQuery/1.11.1/ and so on so you can introduce new versions without breaking solutions built on older versions. As far as referencing jQuery in your pages, you can add ...


0

The best way I have found to do this is to just go ahead and load them into your masterpage. Use this link here in the head: <SharePoint:ScriptLink language="javascript" name="MyJquery.js" defer="true" runat="server"/> The script link tag will always point to the /_LAYOUTS/1033 folder so put your JQuery file there. This line would load the page ...



Top 50 recent answers are included